We learned to manage the component state while working on the chat application. It was quite sufficient for that small example. However, as the application grows larger, you may notice that multiple components tend to share the state. We know how to lift the state up. But which exact component then shall manage the state? Where does the state belong? We can avoid this ambiguity by drawing on Redux, a JavaScript library known as a predictable state container. Redux implies an application-wide state tree. When we need to set the state for a component, we update the corresponding node in the global state tree. All the subscribed modules immediately receive the updated state tree. Thus, we can always easily find out what is ...
Comprehending redux
Get Cross-platform Desktop Application Development: Electron, Node, NW.js, and React now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.