UNPKG

@aivron/sync-storage

Version:

A universal, synchronous storage solution for React (web & desktop) with support for core operations, bulk actions, JSON, TTL, and React hooks. For React Native, use @aivron/async-storage.

10 lines (9 loc) 449 B
import { StorageType } from "./bulk"; /** * A React hook that performs storage cleanup based on a predicate. * This hook is intended for React web and desktop (Electron) projects. * * @param predicate - A function that returns true for keys to remove. * @param storage - Optional custom storage adapter (defaults to localStorage). */ export declare function useStorageCleanup(predicate: (key: string) => boolean, storage?: StorageType): void;