Module

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

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

Type Parameters

Value
Args extends unknown[]
Result

Parameters

anAtom: WritableAtom<Value, Args, Result>

Returns

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

Type Parameters

Value
Args extends unknown[]
Result
PendingValue

Parameters

anAtom: WritableAtom<Value, Args, Result>
fallback: (prev?: Awaited<Value>) => PendingValue

Returns

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

Parameters

anAtom: Atom<Value>

Returns

Atom<Awaited<Value> | undefined>

Type Parameters

Value
PendingValue

Parameters

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

Returns

Atom<Awaited<Value> | PendingValue>