The only use case for
bindActionCreators is when you want to pass some action creators down to a component that isn't aware of Redux, and you don't want to pass
dispatch or the Redux store to it.
For convenience, you can also pass an action creator as the first argument, and get a dispatch wrapped function in return.
actionCreators(Function or Object): An action creator, or an object whose values are action creators.
(Function or Object): An object mimicking the original object, but with each function immediately dispatching the action returned by the corresponding action creator. If you passed a function as
actionCreators, the return value will also be a single function.
You might ask: why don't we bind the action creators to the store instance right away, like in classical Flux? The problem is that this won't work well with universal apps that need to render on the server. Most likely you want to have a separate store instance per request so you can prepare them with different data, but binding action creators during their definition means you're stuck with a single store instance for all requests.
If you use ES5, instead of
import * assyntax you can just pass
bindActionCreatorsas the first argument. The only thing it cares about is that the values of the
actionCreatorsproperties are functions. The module system doesn't matter.