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

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

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

Type Parameters

Value
Args extends unknown[]
Result

Returns

WritableAtom<Awaited<Value> | undefined, Args, Result>

Type Parameters

Value
Args extends unknown[]
Result
PendingValue

Parameters

fallback: (prev?: Awaited<Value>) => PendingValue

Returns

Atom<Awaited<Value> | undefined>

Type Parameters

Value
PendingValue

Parameters

anAtom: Atom<Value>
fallback: (prev?: Awaited<Value>) => PendingValue