State is Granular


Design thinking Problem with State Managment in an Web Application

Most of the time we tend to live in world of Redux, we donโ€™t tend to think about State, we start thinking

Redux = State and State = Redux and this is just the way it is and get stuck in this thinking loop.

But when we get away from redux for a second, we can see we have complety different patterns in our State of an application and can be implemeted differently with methods that are more suited for those patterns.

We can see that

๐’๐ญ๐š๐ญ๐ž ๐ข๐ฌ ๐†๐ซ๐š๐ง๐ฎ๐ฅ๐š๐ซ and we can have atleast 4 different types of State

1. ๐‹๐จ๐œ๐š๐ฅ ๐’๐ญ๐š๐ญ๐ž: State that is managed within a single component in an application. It is not shared with other components and is used to manage component-specific data. Like Dropdown is open or closed.

2. ๐‘๐ž๐ฆ๐จ๐ญ๐ž ๐’๐ญ๐š๐ญ๐ž: State that is managed on a remote server or database, such as data fetched from an API. It is accessed asynchronously and is typically shared among multiple components.

3. ๐€๐ฌ๐ฒ๐ง๐œ ๐’๐ญ๐š๐ญ๐ž: State that is loaded asynchronously, can be loading or error state. Mostlt this goes hand in hand with Remote State.

4. ๐’๐ก๐š๐ซ๐ž๐ ๐’๐ญ๐š๐ญ๐ž: State that is shared among multiple components in an application. Behavior of components can be driven by the state it shares with other components.

Furthermore this states can be composed with each other to drive. the behavior of an application.

Only with these type of design thinking while using state management can be used to build truly scalable applications.