web-api-hooks
Version:
Essential set of React Hooks for convenient Web API consumption.
4 lines (3 loc) • 315 B
TypeScript
/// <reference types="react" />
import { JSONValue } from './types';
export default function useStorage<T extends JSONValue>(getStorage: () => Storage | null, key: string, initialValue?: T | (() => T) | null, errorCallback?: (error: DOMException | TypeError) => void): [T, React.Dispatch<React.SetStateAction<T>>];