AppsNewsTechnology

The Importance of State Management

You may wonder why the concept of state management is introduced in this chapter. Let’s start with a brief history of web applications. In the early days of the Internet era, the web pages were very simple. They just displayed static content and offered very limited user interactions. Some business logic has shifted from the server-side to the browser-side. A typical example is the Gmail web app. These kinds of web apps may have complicated page flows and offer rich user interactions. Since these web apps usually have only one web page, they are called Single Page Applications, or SPAs. Ionic apps are a typical example of SPAs.

After complicated logic is added to the front end, we need to manage the state inside of web apps. For typical SPAs, there are three kinds of states to manage.

  • Global state: This state contains global data shared by all pages, including system configurations and metadata. This state is usually populated from the server-side when the app is loaded and rarely changes during the whole life cycle of the app.
  • State to share between pages and components. This state is necessary for collaboration between different pages and components. States can be passed between different pages using the router, while components can share states using ancestor components or custom events.
  • Internal state for components. Some components may have complicated user interactions or back-end communications, so they need to manage their own state. For example, a complex form needs to enable/ disable form controls based on user input or results of validation logic.Read more about 7starhdCheck out to know about Pii-email. On the other hand you can also know about Pii-email.

Related Articles

Leave a Reply

Check Also
Close

Back to top button