react-localstorage-hooks
Version:
A collection of React hooks for reactively managing localStorage
11 lines (10 loc) • 458 B
TypeScript
import { LocalStorageReducer } from '../useLocalStorageReducer/useLocalStorageReducer';
/**
* A function to create a dispatcher that updates data stored on localStorage.
*
* @param key key for localStorage
* @param reducer reducer method that returns new data
* @returns a dispatch method
*/
declare function createLocalStorageDispatch<T>(key: string, reducer: LocalStorageReducer<T>): (action: any) => void;
export default createLocalStorageDispatch;