UI - State

> User Interface (GUI)

1 - About

state in design

Set is the minimum set of variable that defines the state of an block or app.

State allows an application to change their output (console or UI) over time in response to user actions, network responses, and anything else.

State is generally reserved for interactivity.

State is generally what must be saved in order to be able to restore the visual or behavior of an application (or components) after restart.

Advertising

3 - Example

Example:

  • On/Off
  • Color

For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array.

4 - Rules

If the answer to the below question is yes, it probably isn't state.

  • Does it remain unchanged over time?
  • Can you compute it based on any other state ?

A strategy to achieve no inconsistent state.: Make sure that everything that can be derived from the application state, will be derived automatically (Mobx)

ui/state.txt · Last modified: 2017/09/17 17:36 by gerardnico