git.fiddlerwoaroof.com
Browse code

Fixing issue where saga doesn't run after init - page load functions correctly

Max Summe authored on 17/06/2017 20:29:07
Showing 1 changed files
... ...
@@ -94,7 +94,7 @@ const store = createStore(reduce,
94 94
       sagaMiddleware
95 95
       )
96 96
     ));
97
-init();
97
+
98 98
 
99 99
 const fetchArticle = function*({id}) {
100 100
   console.log('SAGA???');
... ...
@@ -113,6 +113,8 @@ const saga = function *() {
113 113
 };
114 114
 
115 115
 sagaMiddleware.run(saga);
116
+// this needs to be after sagaMiddleware.run so that sagas can handle our route-dispatched actions.
117
+init();
116 118
 
117 119
 const actions = {
118 120
   changeId: allActions.changeId