UNPKG

jotai

Version:

👻 Next gen state management that will spook you

6 lines (5 loc) • 558 B
import type { Draft } from 'immer'; import type { WritableAtom } from 'jotai'; import type { 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];