@sampettersson/constate
Version:
Yet another React state management library that lets you work with local state and scale up to global state with ease
6 lines (5 loc) • 695 B
TypeScript
import { ActionMap, SelectorMap, EffectMap, StateUpdater, EffectProps, Dictionary, SetStateWithType } from "./types";
export declare const mapSetStateToActions: <S, P>(setState: SetStateWithType<S, keyof P>, actionMap: ActionMap<S, P>) => Dictionary<(...args: any[]) => void>;
export declare const mapStateToSelectors: <S, P>(state: S, selectorMap: SelectorMap<S, P>) => Dictionary<(...args: any[]) => any>;
export declare const mapPropsToEffects: <S, P>(getEffectProps: (type: keyof P) => EffectProps<S>, effectMap: EffectMap<S, P>) => Dictionary<(...args: any[]) => any>;
export declare const parseUpdater: <S, _ = never>(updaterOrState: StateUpdater<S> | Partial<S>, state: S) => Partial<S>;