@restate/core
Version:
_Restate_ is a predictable, easy to use, easy to integrate, typesafe state container for [React](https://reactjs.org/).
12 lines • 711 B
TypeScript
/// <reference types="react" />
import { RestateStore } from './rx-store';
type SelectorFunction<S, T> = (state: S) => T;
export interface StateHookProps<S> {
deps?: any;
compare?: (previous: S, next: S) => boolean;
}
export type UseSelectorHook<S> = <T>(selectorFunction: SelectorFunction<S, T>, props?: StateHookProps<T>) => T;
export declare function createSelectorHook<S extends Object>(context: React.Context<RestateStore<S>>): UseSelectorHook<S>;
export declare function createSelectorHook<S extends Object, SUB_STATE>(context: React.Context<RestateStore<S>>, outerSelector: SelectorFunction<S, SUB_STATE>): UseSelectorHook<SUB_STATE>;
export {};
//# sourceMappingURL=create-selector-hook.d.ts.map