UNPKG

jotai

Version:

👻 Next gen state management that will spook you

11 lines • 519 B
import { Atom, ExtractAtomValue } from 'jotai/vanilla'; import { useStore } from './Provider'; type Store = ReturnType<typeof useStore>; type Options = { store?: Store; delay?: number; }; export declare function useAtomValue<Value>(atom: Atom<Value>, options?: Options): Awaited<Value>; export declare function useAtomValue<AtomType extends Atom<unknown>>(atom: AtomType, options?: Options): Awaited<ExtractAtomValue<AtomType>>; export {}; declare type Awaited<T> = T extends Promise<infer V> ? V : T;