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
+4-20Lines changed: 4 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@ hide_title: true
7
7
8
8
# `createSlice`
9
9
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.
10
+
A function that accepts an initial state, an object full of reducer functions, and optionally a "slice name",
11
+
and automatically generates action creators and action types that correspond to the reducers and state.
11
12
12
13
## Parameters
13
14
@@ -19,7 +20,7 @@ function createSlice({
19
20
reducers: Object<string, ReducerFunction>
20
21
// The initial state for the reducer
21
22
initialState: any,
22
-
// An optional name, used in action types and selectors
23
+
// An optional name, used in action types
23
24
slice?: string,
24
25
// An additional object of "case reducers". Keys should be other action types.
25
26
extraReducers?: Object<string, ReducerFunction>
@@ -45,16 +46,7 @@ The initial state value for this slice of state.
45
46
46
47
### `slice`
47
48
48
-
Anoptionalstringnameforthissliceofstate.
49
-
50
-
Theslicenameisusedintwoways.
51
-
52
-
First, ifprovided, generatedactiontypeconstants will use this as a prefix.
0 commit comments