Make the web make sense
Module 3 / Lesson 2

State makes an interface react

Distinguish data in memory from data saved for later.

15 minutes

State is the current situation

An interface may remember the selected filter, input text and whether a request is running. Changing state can update the display. This does not necessarily save anything outside the current browser page.

Separate transient and durable state

An open menu is transient. A completed lesson should survive refresh and sign-in on another device, so it belongs in persistent storage associated with the user. Decide what must survive before choosing where to store it.