Module exposing: useStorage
// Source: https://github.com/mlaursen/react-md | License: MIT | Copyright 2015 Mikkel Laursen
// Provided via justclaw.it.com; keep this notice with the code.
"use client";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useSsr } from "../SsrProvider.js";
import { type UseStateSetter } from "../types.js";
import { useIsomorphicLayoutEffect } from "../useIsomorphicLayoutEffect.js";
import { getStorageSerializers } from "./internalUtils.js";
import { type StorageImplementation, type StorageOptions } from "./types.js";
import {
getItemFromStorage,
removeItemFromStorage,
setItemInStorage,
} from "./utils.js";
/**
* The `useStorage` hook can be used to read and write from `localStorage`
* (default) or `sessionStorage`. The default behavior will au
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key