global-hook
Version:
A global version of the useState React hook with a simple API.
6 lines (5 loc) • 369 B
TypeScript
import { Dispatch, SetStateAction } from 'react';
declare function createUseGlobalState(): <T>(initialState: T | (() => T), namespace: string) => readonly [T, Dispatch<SetStateAction<T>>];
declare const _default: <T>(initialState: T | (() => T), namespace: string) => readonly [T, Dispatch<SetStateAction<T>>];
export default _default;
export { createUseGlobalState };