You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really nice to allow the top level component to hold all state, and pass state down to each component through props. This would make each child component in the tree more modular, without a dependency on a global Redux store. The big problem I see is making updates to the global store from within child components. There are a couple ways I can see to do it. One way is to raise an event when the global store needs to change. The top level component can register listeners for those events and then dispatch onto its store. The event handling will be asynchronous though, which might have drawbacks. It gets rid of the possibility of updating global state synchronously, and you have no way of awaiting the state change as far as I can tell.
Another way is to export the top level or pass it down through the props. But then that kind of defeats the while purpose of lossely-coupling the components and the global store. We've just added the dependency back.
If we can figure out how to await the global store change, that might work.
The text was updated successfully, but these errors were encountered:
It would be really nice to allow the top level component to hold all state, and pass state down to each component through props. This would make each child component in the tree more modular, without a dependency on a global Redux store. The big problem I see is making updates to the global store from within child components. There are a couple ways I can see to do it. One way is to raise an event when the global store needs to change. The top level component can register listeners for those events and then dispatch onto its store. The event handling will be asynchronous though, which might have drawbacks. It gets rid of the possibility of updating global state synchronously, and you have no way of awaiting the state change as far as I can tell.
Another way is to export the top level or pass it down through the props. But then that kind of defeats the while purpose of lossely-coupling the components and the global store. We've just added the dependency back.
If we can figure out how to await the global store change, that might work.
The text was updated successfully, but these errors were encountered: