Skip to content

State management

Defining where current application state lives, who changes it and which views are derived from it.

Software architecture

What is state management?

State management organises the current state of an application or user interface: where does it live, which component may change it and which other parts read it? Related state should remain consistent. Values that can reliably be calculated from existing data often do not need to be stored separately. A global store or particular library is not always necessary.

In a fictional portal, a person selects a status filter. The visible order list is calculated from existing orders and that selection. Maintaining the selection and filtered list as independent state can let them drift apart. The selected filter is also different from the approval status stored on the server. Browser state proves neither successful storage nor current access rights; the server must still check these.

Sources