You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, a `settled` matcher is attached, for matching against both fulfilled and rejected actions. Conceptually this is similar to a `finally` block.
231
+
232
+
Make sure you use `addMatcher` instead of `addCase`, since `settled` is a matcher rather than an action creator.
Theconfigurationobjectcancontaincasereducersforeachofthe [lifecycleactions](./createAsyncThunk#promise-lifecycle-actions) (`pending`, `fulfilled`, and `rejected`), as well as a `settled` reducer that will run for both fulfilled and rejected actions (note that this will run _after_ any provided `fulfilled`/`rejected` reducers. Conceptually it can be thought of like a `finally` block.).
270
270
271
271
Each case reducer will be attached to the slice's `caseReducers` object, e.g. `slice.caseReducers.fetchTodo.fulfilled`.
Typing for the `create.asyncThunk` works in the same way as [`createAsyncThunk`](../usage/usage-with-typescript#createasyncthunk), with one key difference.
302
304
303
305
A type for `state` and/or`dispatch`_cannot_beprovidedaspartofthe`ThunkApiConfig`, asthiswouldcausecirculartypes.
@@ -488,7 +491,9 @@ As a result, there are two ways of getting final selectors:
488
491
489
492
Most commonly, the slice is reliably mounted under its [`reducerPath`](#reducerPath).
490
493
491
-
Following this, the slice has a `selectors` object attached, which creates selectors with the assumption that the slice is located under `rootState[slice.reducerPath]`.
494
+
Following this, the slice has a `selectSlice` selector attached, which assumes that the slice is located under `rootState[slice.reducerPath]`.
495
+
496
+
`slice.selectors` then uses this selector to wrap each of the selectors provided.
0 commit comments