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
Copy file name to clipboardExpand all lines: docs/api/createSlice.md
+81-1Lines changed: 81 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,87 @@ hide_title: true
9
9
10
10
A function that accepts an initial state, an object full of reducer functions, and optionally a "slice name", and automatically generates action creators, action types, and selectors that correspond to the reducers and state.
11
11
12
-
The reducers will be wrapped in the [`createReducer()` utility](createReducer.md), and so they can safely "mutate" the state they are given.
12
+
## Parameters
13
+
14
+
`createSlice` accepts a single configuration object parameter, with the following options:
15
+
16
+
```ts
17
+
function configureStore({
18
+
// An object of "case reducers". Key names will be used to generate actions.
19
+
reducers: Object<string, ReducerFunction>
20
+
// The initial state for the reducer
21
+
initialState: any,
22
+
// An optional name, used in action types and selectors
0 commit comments