File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -233,9 +233,9 @@ Result's function `getInitialState` provides access to the initial state value g
233
233
## Examples
234
234
235
235
` ` ` ts
236
- import { createSlice, createAction } from '@reduxjs/toolkit'
236
+ import { createSlice, createAction, configureStore } from '@reduxjs/toolkit'
237
237
import type { PayloadAction } from '@reduxjs/toolkit'
238
- import { createStore, combineReducers } from 'redux'
238
+ import { combineReducers } from 'redux'
239
239
240
240
const incrementBy = createAction<number>('incrementBy')
241
241
const decrementBy = createAction<number>('decrementBy')
@@ -282,13 +282,13 @@ const user = createSlice({
282
282
},
283
283
})
284
284
285
- const reducer = combineReducers({
286
- counter: counter.reducer,
287
- user: user.reducer,
285
+ const store = configureStore({
286
+ reducer: {
287
+ counter: counter.reducer,
288
+ user: user.reducer,
289
+ },
288
290
})
289
291
290
- const store = createStore(reducer)
291
-
292
292
store.dispatch(counter.actions.increment())
293
293
// -> { counter: 1, user: {name : '', age: 21} }
294
294
store.dispatch(counter.actions.increment())
You can’t perform that action at this time.
0 commit comments