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

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

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

Parameters

arrAtom: WritableAtom<Item[], [Item[]], void>
optional
keyExtractor: (item: Item) => Key

Returns

WritableAtom<PrimitiveAtom<Item>[], [SplitAtomAction<Item>], void>

Parameters

arrAtom: Atom<Item[]>
optional
keyExtractor: (item: Item) => Key

Returns

Atom<Atom<Item>[]>