A common use case for bindActionCreators
(at least with React) is as follows:
const mapDispatchToProps = (dispatch) => bindActionCreators({
myActionCreator,
anotherActionCreator
}, dispatch);
If the function were auto-curried (can be called with two arguments, but will return a function if called with only one argument) that could be simplified to:
const mapDispatchToProps = bindActionCreators({
myActionCreator,
anotherActionCreator
});
dispatch
come from??!!")If this is something worth exploring, I'd be happy to open a pull request so we can see what an actual implementation would look like.
Yeah, let's do a PR and discuss this with some real code behind it.
Given that we already have the object shorthand for connect
, I'm not sure I see the exact use case here.
@markerikson Good point.