UNPKG

491 BTypeScriptView Raw
1import type { Atom } from 'jotai';
2type ShouldRemove<Param> = (createdAt: number, param: Param) => boolean;
3export interface AtomFamily<Param, AtomType> {
4 (param: Param): AtomType;
5 remove(param: Param): void;
6 setShouldRemove(shouldRemove: ShouldRemove<Param> | null): void;
7}
8export declare function atomFamily<Param, AtomType extends Atom<unknown>>(initializeAtom: (param: Param) => AtomType, areEqual?: (a: Param, b: Param) => boolean): AtomFamily<Param, AtomType>;
9export {};