MENU
Matching Utilities
So far we have seen here how isAnyOf() can be used in the matcher of a listener middleware.
Redux Toolkit exports several other matching utilities that you can leverage to check for specific kinds of actions. These are primarily useful for writing the builder.addMatcher() cases in createSlice and createReducer, as well as custom middleware.:
- isAllOf - returns true when all conditions are met
- isAnyOf - returns true when at least one of the conditions are met
- isAsyncThunkAction - accepts one or more action creators and returns true when all match
- isPending - accepts one or more action creators and returns true when all match
- isFulfilled - accepts one or more action creators and returns true when all match
- isRejected - accepts one or more action creators and returns true when all match
- isRejectedWithValue - accepts one or more action creators and returns true when all match