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

x/jotai/src/vanilla.ts>atom

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

Type Parameters

Value
Args extends unknown[]
Result

Parameters

read: Read<Value, SetAtom<Args, Result>>
write: Write<Args, Result>

Type Parameters

Value
Args extends unknown[]
Result

Parameters

initialValue: Value
write: Write<Args, Result>

Returns

WritableAtom<Value, Args, Result> & WithInitialValue<Value>

Parameters

initialValue: Value

Returns

PrimitiveAtom<Value> & WithInitialValue<Value>