UNPKG

jotai-history

Version:
10 lines • 458 B
import type { Atom, WritableAtom } from 'jotai'; import { RESET } from './actions'; export type History<Value> = Value[]; /** * @param targetAtom an atom or derived atom * @param limit the maximum number of history states to keep * @returns an atom with an array of history states */ export declare function withHistory<Value>(targetAtom: Atom<Value>, limit: number): WritableAtom<History<Value>, [RESET], void>; //# sourceMappingURL=withHistory.d.ts.map