You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Reddit API example (http://rackt.org/redux/docs/advanced/ExampleRedditAPI.html), handleRefreshClick dispatches two actions invalidateReddit and fetchPostsIfNeeded which should be executed sequentially in order for the code to work correctly - which is something that Redux does not guarantee as far as I know.
My concern is that if fetchPostsIfNeeded is executed before invalidateReddit notifies the reducer to alter the state with didInvalidate = true, then the code will not work correctly..or maybe there's something I'm missing here?
The text was updated successfully, but these errors were encountered:
dispatches two actions invalidateReddit and fetchPostsIfNeeded which should be executed sequentially in order for the code to work correctly - which is something that Redux does not guarantee as far as I know.
Actions are dispatched synchronously so Redux guarantees the store has received the next state before accepting the next action. Because invalidateReddit is synchronous, any action dispatched from asynchronous fetchPostsIfNeeded is guaranteed to happen after it.
In the Reddit API example (http://rackt.org/redux/docs/advanced/ExampleRedditAPI.html),
handleRefreshClick
dispatches two actionsinvalidateReddit
andfetchPostsIfNeeded
which should be executed sequentially in order for the code to work correctly - which is something that Redux does not guarantee as far as I know.My concern is that if
fetchPostsIfNeeded
is executed beforeinvalidateReddit
notifies the reducer to alter the state withdidInvalidate = true
, then the code will not work correctly..or maybe there's something I'm missing here?The text was updated successfully, but these errors were encountered: