Created
February 6, 2016 09:01
-
-
Save evturn/b4f245658d58f6cc1978 to your computer and use it in GitHub Desktop.
Redux flow & asynchronicity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sup. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Redux
Actions
redux-thunk
By using this specific middleware, an action creator can return a function instead of an action object. This way, the action creator becomes a Thunk
Middleware
redux
Redux middleware solves different problems than Express or Koa middleware, but in a conceptually similar way. It provides a third-party extension point between dispatching an action, and the moment it reaches the reducer. People use Redux middleware for logging, crash reporting, talking to an asynchronous API, routing, etc.
Without middleware, Redux store only supports synchronous data flow. This is what you get by default with
createStore()
createStore()
withapplyMiddleware()
applyMiddleware()
store enhancer from Redux to include the Redux Thunk middleware in thedispatch
mechanism.