-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Start API change for connect decorator #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We should also probably not export the components and only have the provide/connect decorators exposed |
@@ -4,7 +4,7 @@ import shallowEqualScalar from '../utils/shallowEqualScalar'; | |||
export default function createConnectDecorator(React, Connector) { | |||
const { Component } = React; | |||
|
|||
return function connect(select) { | |||
return function connect(slicer, actionCreators) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change it to selector
. We call them selectors in the Redux documentation, as well as in reselect API.
We can rename slice
to selectedState
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Either way, slice
isn't a public API so we may as well call it anything.)
Hey, thanks! I intended to start in a slightly different direction. Can you please completely remove After this chunk of work is ready, we can bikeshed on action creator binding a little bit more. :-) |
@Keats Not sure if this will help, but here is the implementation I did as a shim from fluxxor to redux to aid in us converting: https://gist.github.com/aaronjensen/95e505cdcbbe9d46019d This skips the need for @gaearon one thing we noticed is that there are times when we want to pass the props to the selector function. Can you think of any reasons that'd be a bad idea? Also, it looks like you envisioned not proxying the props along in the default merge, so your default merge would just be |
You can make your
I'd rather have |
Start of some work on #1
Rename select to slicer to be clearer (and goes well with the existing variable this.state.slice which is the result of calling slicer
Add binding for action creator, a tad different from what was suggested in the thread:
I haven't done merge yet as there are still things unclear imo (what happens if you get several part of the state etc) and I wasn't sure whether I missed something from the discussion so I'll add merge if everything is ok and clear