UNPKG

@plq/use-persisted-state

Version:
4 lines (2 loc) 191 B
export type UsePersistedState<T> = [T, (value: T | ((previousState: T) => T)) => void | Promise<void>] export type PersistedState = <T>(key: string, initialValue: T) => UsePersistedState<T>