UNPKG

jotai

Version:

👻 Next gen state management that will spook you

10 lines (9 loc) • 499 B
import type { Atom } from 'jotai'; declare type ShouldRemove<Param> = (createdAt: number, param: Param) => boolean; export interface AtomFamily<Param, AtomType> { (param: Param): AtomType; remove(param: Param): void; setShouldRemove(shouldRemove: ShouldRemove<Param> | null): void; } export declare function atomFamily<Param, AtomType extends Atom<unknown>>(initializeAtom: (param: Param) => AtomType, areEqual?: (a: Param, b: Param) => boolean): AtomFamily<Param, AtomType>; export {};