Overview
lsStore and ssStore are shared AtomType<Record | null> bags on utils (MatesUtils). Both persist under the key mates_storage — local vs session respectively.
lsStore hydrates on create, writes JSON on every set/update, and syncs from other tabs via the storage event. ssStore is tab-scoped session storage (no cross-tab sync).
Both start as null on first visit. Call .set({…}) before .update() — update is a no-op while null. Values must be JSON-serialisable.
lsStore vs ssStore
|
API
|
Backend
|
Sync
|
|---|---|---|
lsStore
| localStorage | Survives reloads; cross-tab via storage event. |
ssStore
| sessionStorage | Tab session only; no cross-tab sync. |
lsStore — persistent clicks
set() seeds the bag; update() patches in place. Reload the preview — clicks survive in localStorage (mates_storage).
ssStore — session draft
Same API as lsStore, backed by sessionStorage. Useful for ephemeral drafts that should not cross tabs.