@@ -448,40 +448,40 @@ export class Overmind<ThisConfig extends IConfiguration>
448448 value : safeValue ( value ) ,
449449 } )
450450
451- action [ IS_OPERATOR ]
452- ? action (
453- null ,
454- {
455- value,
456- state : this . proxyStateTree . state ,
457- actions : this . actions ,
458- execution,
459- effects : this . trackEffects ( this . effects , execution ) ,
460- } ,
461- ( err , finalContext ) => {
462- finalContext &&
463- this . eventHub . emit ( EventType . ACTION_END , {
464- ...finalContext . execution ,
465- operatorId : finalContext . execution . operatorId - 1 ,
466- isIntercepted : finalContext . isIntercepted ,
467- } )
468- if ( err ) reject ( err )
469- else
470- resolve (
471- this . mode . mode === MODE_TEST
472- ? finalContext . execution
473- : undefined
474- )
475- }
476- )
477- : resolve (
478- action (
479- this . createContext ( execution , execution . getMutationTree ( ) ) ,
480- value
481- )
482- ? undefined
483- : undefined
484- )
451+ if ( action [ IS_OPERATOR ] ) {
452+ action (
453+ null ,
454+ {
455+ value,
456+ state : this . proxyStateTree . state ,
457+ actions : this . actions ,
458+ execution,
459+ effects : this . trackEffects ( this . effects , execution ) ,
460+ } ,
461+ ( err , finalContext ) => {
462+ finalContext &&
463+ this . eventHub . emit ( EventType . ACTION_END , {
464+ ...finalContext . execution ,
465+ operatorId : finalContext . execution . operatorId - 1 ,
466+ isIntercepted : finalContext . isIntercepted ,
467+ } )
468+ if ( err ) reject ( err )
469+ else
470+ resolve (
471+ this . mode . mode === MODE_TEST
472+ ? finalContext . execution
473+ : undefined
474+ )
475+ }
476+ )
477+ } else {
478+ action (
479+ this . createContext ( execution , execution . getMutationTree ( ) ) ,
480+ value
481+ )
482+ this . eventHub . emit ( EventType . ACTION_END , execution )
483+ resolve ( )
484+ }
485485 } )
486486 } else {
487487 const execution = {
0 commit comments