jotai
Version:
👻 Next gen state management that will spook you
18 lines (17 loc) • 704 B
TypeScript
import { SECRET_INTERNAL_getScopeContext as getScopeContext } from 'jotai';
import type { Atom } from '../core/atom';
type Scope = NonNullable<Parameters<typeof getScopeContext>[0]>;
type AnyAtomValue = unknown;
type AnyAtom = Atom<AnyAtomValue>;
type AtomsValues = Map<AnyAtom, AnyAtomValue>;
type AtomsDependents = Map<AnyAtom, Set<AnyAtom>>;
type AtomsSnapshot = Readonly<{
values: AtomsValues;
dependents: AtomsDependents;
}>;
/**
* @deprecated use object snapshot instead
*/
type DeprecatedIterableSnapshot = Iterable<readonly [AnyAtom, AnyAtomValue]>;
export declare function useGotoAtomsSnapshot(scope?: Scope): (snapshot: AtomsSnapshot | DeprecatedIterableSnapshot) => void;
export {};