useSessionStorage
Reactive sessionStorage binding. Thin wrapper around useStorage with ObservablePersistSessionStorage as the persist plugin. Values persist only for the current browser session.
See useStorage for details and Legend-State persist & sync for advanced options.
wizard step1 / 5
import { import useSessionStorage
useSessionStorage } from "@usels/web";
function function Component(): any
Component() { const const step$: any
step$ = import useSessionStorage
useSessionStorage("wizard-step", 1);
return ( <any
div> <any
p>Step: {const step$: any
step$.any
get()}</any
p> <any
button onClick: () => any
onClick={() => const step$: any
step$.any
set(const step$: any
step$.any
get() + 1)}>Next</any
button> </any
div> );}Type Declarations
Section titled “Type Declarations”export declare function useSessionStorage<T>(key: string, defaults: T): Observable<T>;Source
Section titled “Source”Contributors
Section titled “Contributors”- tigerwest
Changelog
Section titled “Changelog”a7392ab2026-03-06 - feat(core,browser): add sync strategy hooks (tigerwest)