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.:

All 'thunk matchers' can either be called with one or more thunks as arguments, in which case they will return a matcher function for that condition and thunks, or with one actions, in which case they will match for any thunk action with said condition.