Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jotai/src/vanilla/utils/atomWithReducer.ts>atomWithReducer

👻 Primitive and flexible state management for React
Go to Latest
function atomWithReducer
import { atomWithReducer } from "https://deno.land/x/jotai@v2.9.3/src/vanilla/utils/atomWithReducer.ts";

Type Parameters

Value
Action

Parameters

initialValue: Value
reducer: (value: Value, action?: Action) => Value

Returns

WritableAtom<Value, [Action], void>

Type Parameters

Value
Action

Parameters

initialValue: Value
reducer: (value: Value, action: Action) => Value

Returns

WritableAtom<Value, [Action], void>