File tree Expand file tree Collapse file tree
libs/ngrx-toolkit/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,25 +118,18 @@ function createMutationsFeature<Result extends MutationsDictionary>(
118118 keys . reduce (
119119 ( acc , key ) => ( {
120120 ...acc ,
121- [ key ] : Object . assign (
122- async ( params : never ) => {
123- const mutation = mutations [ key ] ;
124- if ( ! mutation ) {
125- throw new Error ( `Mutation ${ key } not found` ) ;
126- }
121+ [ key ] : ( ( ) => {
122+ const mutation = mutations [ key ] ;
123+ if ( ! mutation ) {
124+ throw new Error ( `Mutation ${ key } not found` ) ;
125+ }
126+
127+ return Object . assign ( async ( params : never ) => {
127128 const result = await mutation ( params ) ;
128129
129130 return result ;
130- } ,
131- {
132- status : mutations [ key ] . status ,
133- value : mutations [ key ] . value ,
134- isPending : mutations [ key ] . isPending ,
135- isSuccess : mutations [ key ] . isSuccess ,
136- error : mutations [ key ] . error ,
137- hasValue : mutations [ key ] . hasValue ,
138- } ,
139- ) ,
131+ } , mutation ) ;
132+ } ) ( ) ,
140133 } ) ,
141134 { } as MethodsDictionary ,
142135 ) ,
You can’t perform that action at this time.
0 commit comments