jotai
Version:
👻 Next gen state management that will spook you
5 lines (4 loc) • 441 B
TypeScript
import type { PrimitiveAtom } from 'jotai';
import type { Scope } from '../core/atom';
export declare function useReducerAtom<Value, Action>(anAtom: PrimitiveAtom<Value>, reducer: (v: Value, a?: Action) => Value, scope?: Scope): [Value, (action?: Action) => void];
export declare function useReducerAtom<Value, Action>(anAtom: PrimitiveAtom<Value>, reducer: (v: Value, a: Action) => Value, scope?: Scope): [Value, (action: Action) => void];