UNPKG

498 BTypeScriptView Raw
1import type { Atom } from 'jotai';
2declare type ShouldRemove<Param> = (createdAt: number, param: Param) => boolean;
3declare type 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 {};