UNPKG

jotai

Version:

👻 Next gen state management that will spook you

8 lines • 638 B
import { Atom, SetStateAction, WritableAtom } from 'jotai'; import { RESET } from './constants'; type Read<Value> = Atom<Value>['read']; export declare function atomWithDefault<Value>(getDefault: Read<Value | Promise<Value>>): WritableAtom<Value, SetStateAction<Value> | typeof RESET>; export declare function atomWithDefault<Value>(getDefault: Read<Promise<Value>>): WritableAtom<Value, SetStateAction<Value> | typeof RESET>; export declare function atomWithDefault<Value>(getDefault: Read<Value>): WritableAtom<Value, SetStateAction<Value> | typeof RESET>; export {}; declare type Awaited<T> = T extends Promise<infer V> ? V : T;