Closed rstacruz closed 8 years ago
store.subscribe(() => updateUI())
Then just pass in the new store.getState()
as either context or a prop.
Cool :)
I investigated a little further and found a few things.
dispatch
, which you'll pass onto dom.createRenderer
. The only use of dispatch
is to be consumed by your own components (so if you don't use dispatch, you don't need it).render(<Component />, store.getState())
(ie the context
), which is simply an object passed onto every component in the tree. Your components are free to consume this context
however it wants.
Do I need to call subscribe() to keep my dom tree updated?
Can I use something other than redux as long as it implements .getState(), .subscribe() and dispatch()?
Should I use a 1 redux store for UI, and 1 other redux store for app data?