Skip to content
FRONTEND

State ownership: what lives on the client, and why

Itiner's draft has to survive a page refresh. Disposable view state, like a filter, doesn't need to. Same framework, different answer.

Not every piece of state deserves the same lifetime

Itiner's draft in progress has to outlive a page refresh, so it can't live only in a component's memory. Disposable view state, a list filter for example, is different: reload the page and re-filtering from scratch costs nothing.

Treating both the same way, either persisting everything or persisting nothing, would be wrong in one direction or the other. The rule that held up: state a user would be upset to lose gets persisted; state that's cheap to recompute doesn't.