react-redux-realworld-example-app
react-redux-realworld-example-app copied to clipboard
Get viewChangeCounter at middleware is always undefined
https://github.com/gothinkster/react-redux-realworld-example-app/blob/cde269d554ac2f1f298c56dbeff1fbd12ee08b92/src/middleware.js#L14 https://github.com/gothinkster/react-redux-realworld-example-app/blob/cde269d554ac2f1f298c56dbeff1fbd12ee08b92/src/middleware.js#L20 https://github.com/gothinkster/react-redux-realworld-example-app/blob/cde269d554ac2f1f298c56dbeff1fbd12ee08b92/src/middleware.js#L30
-
viewChangeCounter
belong to state.common https://github.com/gothinkster/react-redux-realworld-example-app/blob/cde269d554ac2f1f298c56dbeff1fbd12ee08b92/src/reducers/common.js#L23 so to getviewChangeCounter
, you must throughstate.common
-
store.getState().viewChangeCounter;
should bestore.getState().common.viewChangeCounter;
-
currentState.viewChangeCounter
should becurrentState.common.viewChangeCounter
Same.
BTW, in my mind, viewChangeCounter is not a nice way to track async function. Is there a better solution?
Same as well. I was wondering why it isn't 'store.getState().common.viewChangeCounter'