react-use
Version:
Collection of React Hooks
8 lines (7 loc) • 378 B
TypeScript
import { IHookStateInitAction, IHookStateSetAction } from '../misc/hookState';
export declare function createGlobalState<S = any>(initialState: IHookStateInitAction<S>): () => [S, (state: IHookStateSetAction<S>) => void];
export declare function createGlobalState<S = undefined>(): () => [
S,
(state: IHookStateSetAction<S>) => void
];
export default createGlobalState;