jotai-history
Version:
10 lines • 461 B
TypeScript
import type { Atom, WritableAtom } from 'jotai';
import { RESET } from './actions.js';
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