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?
dispatch(invalidateReddit(selectedReddit))
dispatch(fetchPostsIfNeeded(selectedReddit))
invalidateReddit is invoked before fetchPostsIfNeededand is synchronous so the case you described should never happen.
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.
Most helpful comment
Actions are dispatched synchronously so Redux guarantees the store has received the next state before accepting the next action. Because
invalidateRedditis synchronous, any action dispatched from asynchronousfetchPostsIfNeededis guaranteed to happen after it.