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
233233## Examples
234234
235235` ` ` ts
236- import { createSlice, createAction } from '@reduxjs/toolkit'
236+ import { createSlice, createAction, configureStore } from '@reduxjs/toolkit'
237237import type { PayloadAction } from '@reduxjs/toolkit'
238- import { createStore, combineReducers } from 'redux'
238+ import { combineReducers } from 'redux'
239239
240240const incrementBy = createAction<number>('incrementBy')
241241const decrementBy = createAction<number>('decrementBy')
@@ -282,13 +282,13 @@ const user = createSlice({
282282 },
283283})
284284
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+ },
288290})
289291
290- const store = createStore(reducer)
291-
292292store.dispatch(counter.actions.increment())
293293// -> { counter: 1, user: {name : '', age: 21} }
294294store.dispatch(counter.actions.increment())
You can’t perform that action at this time.
0 commit comments