Closed
Description
I'm playing around with selectors, and most of my mapStateToProps
functions look like this:
const mapStateToProps = state => ({
isAuthenticated: selectors.isAuthenticated(state),
isSomethingElse: selectors.isSomethingElse(state),
});
Since I always pass on the state, would it be okay to do the same thing as mapDispatchToProps
does, and just allow sending an object of functions? Like so:
const mapStateToProps = {
isAuthenticated: selectors.isAuthenticated,
isSomethingElse: selectors.isSomethingElse,
};
Then, connect
could do the work required to call each of these with the state.
I'd be happy to submit a PR doing this - but what are your thoughts? I'm sure there's a reason the API is the way it is :)
Metadata
Metadata
Assignees
Labels
No labels