svelte-session-store Svelte Themes

Svelte Session Store

a Svelte writable store that is persisted to sessionStorage

svelte-session-store

With normal Svelte stores their value is lost if the user refreshes the browser. This demonstrates persisting changes to a writable store in sessionStorage so they are automatically restored on refresh.

To run this:

  1. npm install
  2. npm run dev
  3. Add some numbers.
  4. Refresh the browser to see that they are not lost.

Top categories

Loading Svelte Themes