jotai
Version:
👻 Next gen state management that will spook you
12 lines (11 loc) • 462 B
TypeScript
import { Atom, Scope, SetAtom, WritableAtom } from './atom';
declare type ResolveType<T> = T extends Promise<infer V> ? V : T;
export declare function useAtom<Value, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value, Update, Result>, scope?: Scope): [
ResolveType<Value>,
SetAtom<Update, Result>
];
export declare function useAtom<Value>(atom: Atom<Value>, scope?: Scope): [
ResolveType<Value>,
never
];
export {};