UNPKG

574 BTypeScriptView Raw
1import { Draft } from 'immer';
2import { WritableAtom } from 'jotai';
3import { Scope } from '../core/atom';
4export declare function useImmerAtom<Value, Result extends void | Promise<void>>(anAtom: WritableAtom<Value, (draft: Draft<Value>) => void, Result>, scope?: Scope): [
5 Value,
6 (fn: (draft: Draft<Value>) => void) => Result
7];
8export declare function useImmerAtom<Value, Result extends void | Promise<void>>(anAtom: WritableAtom<Value, (value: Value) => Value, Result>, scope?: Scope): [
9 Value,
10 (fn: (draft: Draft<Value>) => void) => Result
11];