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
* A utility function that allows defining a reducer as a mapping from action
156
-
* type to *case reducer* functions that handle these action types. The
157
-
* reducer's initial state is passed as the first argument.
158
-
*
159
-
* The body of every case reducer is implicitly wrapped with a call to
160
-
* `produce()` from the [immer](https://github.com/mweststrate/immer) library.
161
-
* This means that rather than returning a new state object, you can also
162
-
* mutate the passed-in state object directly; these mutations will then be
163
-
* automatically and efficiently translated into copies, giving you both
164
-
* convenience and immutability.
165
-
*
166
-
* @overloadSummary
167
-
* This overload accepts an object where the keys are string action types, and the values
168
-
* are case reducer functions to handle those action types.
169
-
*
170
-
* @param initialState - `State | (() => State)`: The initial state that should be used when the reducer is called the first time. This may also be a "lazy initializer" function, which should return an initial state value when called. This will be used whenever the reducer is called with `undefined` as its state value, and is primarily useful for cases like reading initial state from `localStorage`.
171
-
* @param actionsMap - An object mapping from action types to _case reducers_, each of which handles one specific action type.
172
-
* @param actionMatchers - An array of matcher definitions in the form `{matcher, reducer}`.
173
-
* All matching reducers will be executed in order, independently if a case reducer matched or not.
174
-
* @param defaultCaseReducer - A "default case" reducer that is executed if no case reducer and no matcher
175
-
* reducer was executed for this action.
176
-
*
177
-
* @example
178
-
```js
179
-
const counterReducer = createReducer(0, {
180
-
increment: (state, action) => state + action.payload,
181
-
decrement: (state, action) => state - action.payload
182
-
})
183
-
184
-
// Alternately, use a "lazy initializer" to provide the initial state
"The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"
230
-
)
231
-
}
160
+
thrownewError(
161
+
"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"
"The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"
337
-
)
338
-
}
331
+
thrownewError(
332
+
"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"
0 commit comments