UNPKG

390 BTypeScriptView Raw
1import { Atom, WritableAtom } from './types';
2declare type SetAtom<Update> = undefined extends Update ? (update?: Update) => void | Promise<void> : (update: Update) => void | Promise<void>;
3export declare function useAtom<Value, Update>(atom: WritableAtom<Value, Update>): [Value, SetAtom<Update>];
4export declare function useAtom<Value>(atom: Atom<Value>): [Value, never];
5export {};