@tolokoban/ui
Version:
React components with theme
8 lines • 480 B
TypeScript
/**
* State variable that can be stored in local storage.
* @param defaultValue Default value for initialization.
* @param storageKey Key where to store it in local storage.
* @param ensureType If defined, it is used to transform the value read from storage.
*/
export declare function useLocalStorageState<T>(defaultValue: T, storageKey: string, ensureType?: (value: unknown) => T): [value: T, setValue: (value: T) => void];
//# sourceMappingURL=local-storage-state.d.ts.map