UNPKG

react-tangle

Version:

A Simple State Management Library in React

5 lines (4 loc) 277 B
declare type KeyFnSetter<S> = (currentVal: S) => S; declare type KeySetter<S, K extends keyof S> = (nextVal: S[K] | KeyFnSetter<S[K]>) => void; export declare function useTangledState<S, K extends keyof S>(key: K, defaultV: S[K]): [Readonly<S[K]>, KeySetter<S, K>]; export {};