liveBook · Manning

Local storage

Local storage is a browser-provided, origin-scoped key-value storage mechanism that persistently stores string values across sessions.

How 2 Manning books explain it

Web Components in Action

Local storage is a browser-provided, origin-scoped key-value storage mechanism whose values are strings and can persist across browser sessions.

How it is used
Persists an editable workout plan so the application can reload a previously saved routine after the browser closes.
How deep it goes
Demonstrates string storage, origin-scoped keys, JSON serialization, enumeration, saving, loading, and clearing.
Examples
Uses string key-value snippets and a workout planner that saves, loads, lists, edits, and clears personal routines.
What you can do after
Operate local storage through setItem, getItem, Object.keys, JSON.stringify, and JSON.parse.

Read how Web Components in Action explains local storage →

React Hooks in Action: With Suspense and Concurrent Mode

Local storage is a browser-provided key-value storage mechanism that persists string data across page visits.

How it is used
Persists a selected user so a page can restore the choice after revisits or refreshes.
How deep it goes
Demonstrates reading and writing values through effects, including mount-only and state-dependent dependency behavior.
Examples
Uses a user-selection dropdown whose saved choice is restored after refreshing the page.
What you can do after
Builds a React user picker that restores and persists its selected value with local storage.

Read how React Hooks in Action: With Suspense and Concurrent Mode explains local storage →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.