Skip to content

Commit e99e084

Browse files
committed
test non-function creator
1 parent a12524a commit e99e084

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/toolkit/src/tests/createSlice.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,7 @@ describe('createSlice', () => {
10221022
test('context.selectSlice throws if unable to find slice state', () => {
10231023
const patchCreator: ReducerCreator<typeof patchCreatorType> = {
10241024
type: patchCreatorType,
1025-
create() {
1026-
return { _reducerDefinitionType: patchCreatorType }
1027-
},
1025+
create: { _reducerDefinitionType: patchCreatorType },
10281026
handle({ type }, _def, context) {
10291027
const patchedAction = createAction<Patch[]>(type)
10301028
function patchThunk(
@@ -1062,7 +1060,7 @@ describe('createSlice', () => {
10621060
name: 'person',
10631061
initialState: { name: 'Alice' },
10641062
reducers: (create) => ({
1065-
patchPerson: create.patcher(),
1063+
patchPerson: create.patcher,
10661064
}),
10671065
})
10681066

@@ -1244,7 +1242,7 @@ declare module '@reduxjs/toolkit' {
12441242
>
12451243
[patchCreatorType]: ReducerCreatorEntry<
12461244
State extends Objectish
1247-
? () => ReducerDefinition<typeof patchCreatorType>
1245+
? ReducerDefinition<typeof patchCreatorType>
12481246
: never,
12491247
{
12501248
actions: {

0 commit comments

Comments
 (0)