Building custom client-side state management
Imagine the perfect state management we mentioned in the introduction. What features would that state manager have? It would likely combine the best features from the best-known existing libraries. We would expect features such as the following:
- Global state access: Effortless access to the state from any component
- Predictable state updates: Without unwanted side effects
- Scalability: Easily grow your app to an infinite number of new modules/features, managing data flow complexity with ease
- Reactivity: Carry out an automatic component state refresh whenever there is a state update
- Granular control: The ability to create slices of smaller, more manageable states, each responsible for a specific domain
- Performance: Targeted re-renders for efficient state updates, providing the best possible user experience
- Handling errors and side effects: Gracefully handling network requests and creating resilient...