File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,10 @@ export class Overmind<Config extends Configuration> implements Configuration {
246246 this . trackEffects ( this . effects , execution )
247247 ) ,
248248 ( err , finalContext ) => {
249- this . eventHub . emit (
250- EventType . ACTION_END ,
251- finalContext . execution
252- )
249+ this . eventHub . emit ( EventType . ACTION_END , {
250+ ... finalContext . execution ,
251+ operatorId : finalContext . execution . operatorId - 1 ,
252+ } )
253253 if ( err ) reject ( err )
254254 else resolve ( finalContext . value )
255255 }
@@ -767,9 +767,21 @@ export function action<Input, Config extends Configuration = TheConfig>(
767767 mutationTree . onMutation ( ( mutation ) => {
768768 context . execution . emit ( EventType . MUTATIONS , {
769769 ...context . execution ,
770- operatorId : context . execution . operatorId ,
771770 mutations : makeStringifySafeMutations ( [ mutation ] ) ,
772771 } )
772+ setTimeout ( ( ) => {
773+ const flushData = context . proxyStateTree . flush ( true )
774+ if ( flushData . mutations . length ) {
775+ context . execution . send ( {
776+ type : 'flush' ,
777+ data : {
778+ ...context . execution ,
779+ ...flushData ,
780+ mutations : makeStringifySafeMutations ( flushData . mutations ) ,
781+ } ,
782+ } )
783+ }
784+ } )
773785 } )
774786 }
775787 const maybePromise : any = operation ( {
You can’t perform that action at this time.
0 commit comments