alinea
Version:
Headless git-based CMS
10 lines (9 loc) • 338 B
TypeScript
import { type Atom } from 'jotai';
interface KeepDataOptions<Value> {
initialValue?: Value;
compare?: (a: Value, b: Value) => boolean;
}
export declare function keepPreviousData<Value>(asyncAtom: Atom<Promise<Value>>, options?: KeepDataOptions<Value>): Atom<Promise<Value>> & {
current: Atom<Value | undefined>;
};
export {};