@@ -100,54 +100,54 @@ export function createEntityMethods<
100
100
const reducer = reducerCreator . create
101
101
const reducers : EntityReducers < T , Id , State , 's' , 'p' > = {
102
102
[ `addOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
103
- adapter . addOne ( selectEntityState ( state ) , action . payload )
103
+ adapter . addOne ( selectEntityState ( state ) , action )
104
104
} ) ,
105
105
[ `addMany${ capitalize ( pluralName ) } ` as const ] : reducer <
106
106
readonly T [ ] | Record < Id , T >
107
107
> ( ( state , action ) => {
108
- adapter . addMany ( selectEntityState ( state ) , action . payload )
108
+ adapter . addMany ( selectEntityState ( state ) , action )
109
109
} ) ,
110
110
[ `setOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
111
- adapter . setOne ( selectEntityState ( state ) , action . payload )
111
+ adapter . setOne ( selectEntityState ( state ) , action )
112
112
} ) ,
113
113
[ `setMany${ capitalize ( pluralName ) } ` as const ] : reducer <
114
114
readonly T [ ] | Record < Id , T >
115
115
> ( ( state , action ) => {
116
- adapter . setMany ( selectEntityState ( state ) , action . payload )
116
+ adapter . setMany ( selectEntityState ( state ) , action )
117
117
} ) ,
118
118
[ `setAll${ capitalize ( pluralName ) } ` as const ] : reducer <
119
119
readonly T [ ] | Record < Id , T >
120
120
> ( ( state , action ) => {
121
- adapter . setAll ( selectEntityState ( state ) , action . payload )
121
+ adapter . setAll ( selectEntityState ( state ) , action )
122
122
} ) ,
123
123
[ `removeOne${ capitalize ( name ) } ` as const ] : reducer < Id > ( ( state , action ) => {
124
- adapter . removeOne ( selectEntityState ( state ) , action . payload )
124
+ adapter . removeOne ( selectEntityState ( state ) , action )
125
125
} ) ,
126
126
[ `removeMany${ capitalize ( pluralName ) } ` as const ] : reducer < readonly Id [ ] > (
127
127
( state , action ) => {
128
- adapter . removeMany ( selectEntityState ( state ) , action . payload )
128
+ adapter . removeMany ( selectEntityState ( state ) , action )
129
129
} ,
130
130
) ,
131
131
[ `removeAll${ capitalize ( pluralName ) } ` as const ] : reducer ( ( state ) => {
132
132
adapter . removeAll ( selectEntityState ( state ) )
133
133
} ) ,
134
134
[ `upsertOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
135
- adapter . upsertOne ( selectEntityState ( state ) , action . payload )
135
+ adapter . upsertOne ( selectEntityState ( state ) , action )
136
136
} ) ,
137
137
[ `upsertMany${ capitalize ( pluralName ) } ` as const ] : reducer <
138
138
readonly T [ ] | Record < Id , T >
139
139
> ( ( state , action ) => {
140
- adapter . upsertMany ( selectEntityState ( state ) , action . payload )
140
+ adapter . upsertMany ( selectEntityState ( state ) , action )
141
141
} ) ,
142
142
[ `updateOne${ capitalize ( name ) } ` as const ] : reducer < Update < T , Id > > (
143
143
( state , action ) => {
144
- adapter . updateOne ( selectEntityState ( state ) , action . payload )
144
+ adapter . updateOne ( selectEntityState ( state ) , action )
145
145
} ,
146
146
) ,
147
147
[ `updateMany${ capitalize ( pluralName ) } ` as const ] : reducer <
148
148
readonly Update < T , Id > [ ]
149
149
> ( ( state , action ) => {
150
- adapter . updateMany ( selectEntityState ( state ) , action . payload )
150
+ adapter . updateMany ( selectEntityState ( state ) , action )
151
151
} ) ,
152
152
}
153
153
return reducers as any
0 commit comments