jotai
Version:
👻 Next gen state management that will spook you
4 lines • 367 B
TypeScript
import { Atom } from 'jotai/vanilla';
export declare function unwrap<Value>(anAtom: Atom<Promise<Value>>): Atom<Awaited<Value> | undefined>;
export declare function unwrap<Value, PendingValue>(anAtom: Atom<Promise<Value>>, fallback: (prev?: Value) => PendingValue): Atom<Awaited<Value> | PendingValue>;
declare type Awaited<T> = T extends Promise<infer V> ? V : T;