UNPKG

284 BTypeScriptView Raw
1import type { Atom } from 'jotai';
2type Loadable<Value> = {
3 state: 'loading';
4} | {
5 state: 'hasError';
6 error: unknown;
7} | {
8 state: 'hasData';
9 data: Awaited<Value>;
10};
11export declare function loadable<Value>(anAtom: Atom<Value>): Atom<Loadable<Value>>;
12export {};