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

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

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

Type Parameters

Value
Slice

Parameters

anAtom: Atom<Value>
selector: (v: Awaited<Value>, prevSlice?: Slice) => Slice
optional
equalityFn: (a: Slice, b: Slice) => boolean

Returns

Atom<Value extends Promise<unknown> ? Promise<Slice> : Slice>