import { useSessionStorage } from "https://deno.land/x/netzo@0.4.72/deps/usehooks-ts.ts";
Custom hook for using session storage to persist state across page reloads.
Examples
const [count, setCount] = useSessionStorage('count', 0);
// Access the count
value and the setCount
function to update it.
const [count, setCount] = useSessionStorage('count', 0);
// Access the count
value and the setCount
function to update it.
Parameters
- The initial value of the state or a function that returns the initial value.
optional
options: UseSessionStorageOptions<T>- Options for customizing the behavior of serialization and deserialization (optional).