Actions in multiple slices in Redux toolkit

It looks like this is what extraReducers is for:

One of the key concepts of Redux is that each slice reducer “owns” its slice of state, and that many slice reducers can independently respond to the same action type. extraReducers allows createSlice to respond to other action types besides the types it has generated.

It is a little strange that the action dispatcher should know which reducer the action belongs. I’m not sure the motivation of having reducers and extraReducers, but you can use extraReducers to allow several slices to respond to the same action.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)