UNPKG

454 BTypeScriptView Raw
1import type { Atom } from 'jotai';
2type ResolveAtom<T> = T extends Atom<infer V> ? V : T;
3type AwaitedAtom<T> = Awaited<ResolveAtom<T>>;
4export declare function waitForAll<Atoms extends Atom<unknown>[]>(atoms: readonly [...Atoms]): Atom<{
5 [K in keyof Atoms]: AwaitedAtom<Atoms[K]>;
6}>;
7export declare function waitForAll<Atoms extends Record<string, Atom<unknown>>>(atoms: Atoms): Atom<{
8 [K in keyof Atoms]: AwaitedAtom<Atoms[K]>;
9}>;
10export {};