@vergiss/chooks
Version:
React hooks library
8 lines (7 loc) • 320 B
TypeScript
interface UseLocalStorageOption {
expireAge?: number;
updateWhenInit?: boolean;
}
declare type StorageUpdater<T> = (updatedData: T) => void;
declare function useLocalStorage(key: string, defaultValue: any, options?: UseLocalStorageOption): [any, StorageUpdater<any>];
export { useLocalStorage, StorageUpdater };