Skip to content

Commit ce04544

Browse files
committed
add note about addMatcher order
1 parent 6226c1d commit ce04544

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/usage/custom-slice-creators.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,14 @@ context.addMatcher(matcher, reducer)
462462

463463
Returns the context object to allow chaining.
464464

465+
:::tip
466+
467+
Unlike in `createReducer` and `extraReducers`, there is no requirement to call `addMatcher` _after_ `addCase` - the correct order will be applied when the reducer is built.
468+
469+
You should still be aware that case reducers will be called before matcher reducers, if both match a given action.
470+
471+
:::
472+
465473
#### `exposeAction`
466474

467475
Attaches a value to `slice.actions[reducerName]`.

0 commit comments

Comments
 (0)