Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.3k
Closed
Description
This API is taken from Redux<Provider>,<Connector>,@provide,@connect.
Right now I don't have examples in this repo but it matches what you've seen in Redux so far.
It's the best we've got now, but I think we can do better!
Common pain points:
- Not intuitive how way to separate smart and dumb components with
<Connector>,@connect - You have to manually bind action creators with
bindActionCreatorshelper whichsome don't like - Too much nesting for small examples (
<Provider>,<Connector>both need function children)
Let's go wild here. Post your alternative API suggestions.
They should satisfy the following criteria:
- Some component at the root must hold the
storeinstance. (Akin to<Provider>) - It should be possible to connect to state no matter how deep in the tree
- It should be possible to select the state you're interested in with a
selectfunction - Smart / dumb components separation needs to be encouraged
- There should be one obvious way to separate smart / dumb components
- It should be obvious how to turn your functions into action creators
- Smart components should probably be able to react to updates to the state in
componentDidUpdate - Smart components'
selectfunction needs to be able to take their props into account - Smart component should be able to do something before/after dumb component dispatches an action
- We should have
shouldComponentUpdatewherever we can
Metadata
Metadata
Assignees
Labels
No labels