Replies: 1 comment
-
Yes, it does get evaluated after every action. However, it shouldn't be a perf bottleneck. Predicates are supposed to be trivial checks that immediately return a boolean. That's even less work than all the selectors that will run after every action. Now, yes, those are more function calls, so there is an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Redux Team,
I have a question regarding the
createListenerMiddleware
in Redux Toolkit. Specifically, I want to know how thepredicate
function behaves in terms of performance.My Question:
predicate
function get evaluated after every action is dispatched, regardless of the action type or target?predicate
contains more complex logic (e.g., state comparisons or function calls)?createListenerMiddleware
when usingpredicate
?I’m concerned about whether using
predicate
in a heavily action-driven environment could degrade performance, and I’d appreciate any insights or suggestions to avoid potential bottlenecks.Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions