@@ -28,9 +28,9 @@ export type SliceActionCreator<P> = PayloadActionCreator<P>
28
28
* @public
29
29
*/
30
30
export interface Slice <
31
- Name extends string ,
32
31
State = any ,
33
- CaseReducers extends SliceCaseReducers < State > = SliceCaseReducers < State >
32
+ CaseReducers extends SliceCaseReducers < State > = SliceCaseReducers < State > ,
33
+ Name extends string = string
34
34
> {
35
35
/**
36
36
* The slice name.
@@ -61,9 +61,9 @@ export interface Slice<
61
61
* @public
62
62
*/
63
63
export interface CreateSliceOptions <
64
- Name extends string ,
65
64
State = any ,
66
- CR extends SliceCaseReducers < State > = SliceCaseReducers < State >
65
+ CR extends SliceCaseReducers < State > = SliceCaseReducers < State > ,
66
+ Name extends string = string
67
67
> {
68
68
/**
69
69
* The slice's name. Used to namespace the generated action types.
@@ -213,12 +213,12 @@ function getType(slice: string, actionKey: string): string {
213
213
* @public
214
214
*/
215
215
export function createSlice <
216
- Name extends string ,
217
216
State ,
218
- CaseReducers extends SliceCaseReducers < State >
217
+ CaseReducers extends SliceCaseReducers < State > ,
218
+ Name extends string = string
219
219
> (
220
- options : CreateSliceOptions < Name , State , CaseReducers >
221
- ) : Slice < Name , State , CaseReducers > {
220
+ options : CreateSliceOptions < State , CaseReducers , Name >
221
+ ) : Slice < State , CaseReducers , Name > {
222
222
const { name, initialState } = options
223
223
if ( ! name ) {
224
224
throw new Error ( '`name` is a required option for createSlice' )
0 commit comments