react-singleton-hook
Version:
Share custom hook state across all components
16 lines (12 loc) • 363 B
TypeScript
export = ReactSingletonHook;
export as namespace ReactSingletonHook;
declare namespace ReactSingletonHook {
function singletonHook<ValueType>(
initialState: ValueType | (() => ValueType),
useHook: () => ValueType,
options?: {
unmountIfNoConsumers?: boolean
}
): () => ValueType;
function SingletonHooksContainer(): any;
}