UNPKG

jotai

Version:

👻 Next gen state management that will spook you

10 lines • 436 B
import { Atom, Scope, SetAtom, WritableAtom } from './atom'; export declare function useAtom<Value, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value, Update, Result>, scope?: Scope): [ Awaited<Value>, SetAtom<Update, Result> ]; export declare function useAtom<Value>(atom: Atom<Value>, scope?: Scope): [ Awaited<Value>, never ]; declare type Awaited<T> = T extends Promise<infer V> ? V : T;