atomic-state
Version:
Atomic State is a state management library for React
22 lines (21 loc) • 1.18 kB
TypeScript
import { Atom, Selector } from './mod';
export declare const defaultAtomsValues: Map<any, any>;
export declare const atomsInitializeObjects: Map<any, any>;
export declare const filtersInitializeObjects: Map<any, any>;
export declare const defaultAtomsInAtomic: Map<any, any>;
export declare const usedKeys: Map<any, any>;
export declare const defaultFiltersValues: Map<any, any>;
export declare const atomsEffectsCleanupFunctons: Map<any, any>;
export declare const pendingAtoms: Map<any, any>;
/**
* Get the current value of an atom. You can pass a specific prefix as the second argument.
*/
export declare function getAtomValue<R>($atom: Atom<R> | Atom<R, any>, prefix?: string): R;
/**
* Get the current value of a filter. You can pass a specific prefix as the second argument.
*/
export declare function getFilterValue<R>($filter: (() => R | Promise<R>) | Selector<R | Promise<R>>, prefix?: string): R;
export declare const getAtom: typeof getAtomValue;
export declare const getFilter: typeof getFilterValue;
export declare const getSelector: typeof getFilterValue;
export declare function getValue<R = any>(init: Atom<R> | Selector<R>, storeName?: string | boolean): R;