File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
node_modules/overmind/src Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,8 @@ export class Overmind<ThisConfig extends IConfiguration>
306306 proxyStateTree . getMutationTree ( ) . flush ( true )
307307 } )
308308 eventHub . on ( EventType . ACTION_END , ( execution ) => {
309- if ( ! execution . parentExecution ) proxyStateTree . getMutationTree ( ) . flush ( )
309+ if ( ! execution . parentExecution || ! execution . parentExecution . isRunning )
310+ proxyStateTree . getMutationTree ( ) . flush ( )
310311 } )
311312
312313 let nextTick
@@ -332,7 +333,10 @@ export class Overmind<ThisConfig extends IConfiguration>
332333 }
333334 } )
334335 eventHub . on ( EventType . ACTION_END , ( execution ) => {
335- if ( ! execution . parentExecution ) {
336+ if (
337+ ! execution . parentExecution ||
338+ ! execution . parentExecution . isRunning
339+ ) {
336340 const flushData = execution . flush ( )
337341
338342 if ( this . devtools && flushData . mutations . length ) {
@@ -501,6 +505,7 @@ export class Overmind<ThisConfig extends IConfiguration>
501505 effects : this . trackEffects ( this . effects , execution ) ,
502506 } ,
503507 ( err , finalContext ) => {
508+ execution . isRunning = false
504509 finalContext &&
505510 this . eventHub . emit ( EventType . ACTION_END , {
506511 ...finalContext . execution ,
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ const Guides: SFC = () => {
1010 return < Loader />
1111 }
1212
13- console . log ( state . guides )
14-
1513 return (
1614 < div className = { styles . wrapper } >
1715 { state . guides . map ( ( guide ) => (
Original file line number Diff line number Diff line change 11import { OnInitialize } from 'overmind'
22
3- const onInitialize : OnInitialize = async ( { effects, state } , app ) => {
3+ const onInitialize : OnInitialize = async ( { effects, state, actions } ) => {
44 state . showViewHelp = ! effects . storage . get ( 'theme' )
55
6- effects . router . route ( '/' , app . actions . openHome )
7- effects . router . route ( '/guides' , app . actions . openGuides )
8- effects . router . route ( '/guides/:type/:title' , app . actions . openGuide )
9- effects . router . route ( '/videos' , app . actions . openVideos )
10- effects . router . route ( '/videos/:title' , app . actions . openVideo )
11- effects . router . route ( '/api/:title' , app . actions . openApi )
6+ effects . router . route ( '/' , actions . openHome )
7+ effects . router . route ( '/guides' , actions . openGuides )
8+ effects . router . route ( '/guides/:type/:title' , actions . openGuide )
9+ effects . router . route ( '/videos' , actions . openVideos )
10+ effects . router . route ( '/videos/:title' , actions . openVideo )
11+ effects . router . route ( '/api/:title' , actions . openApi )
1212 effects . router . redirect ( '/api' , '/api/action' )
1313
1414 effects . router . start ( )
You can’t perform that action at this time.
0 commit comments