jotai
Version:
👻 Next gen state management that will spook you
12 lines (11 loc) • 574 B
TypeScript
import { Draft } from 'immer';
import { WritableAtom } from 'jotai';
import { Scope } from '../core/atom';
export declare function useImmerAtom<Value, Result extends void | Promise<void>>(anAtom: WritableAtom<Value, (draft: Draft<Value>) => void, Result>, scope?: Scope): [
Value,
(fn: (draft: Draft<Value>) => void) => Result
];
export declare function useImmerAtom<Value, Result extends void | Promise<void>>(anAtom: WritableAtom<Value, (value: Value) => Value, Result>, scope?: Scope): [
Value,
(fn: (draft: Draft<Value>) => void) => Result
];