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

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

👻 Primitive and flexible state management for React
Go to Latest
function unwrap
import { unwrap } from "https://deno.land/x/jotai@v2.9.3/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>