Type Alias: AsyncAtomState<TData, TError>
API / @xmachines/play-atom / AsyncAtomState
type AsyncAtomState<TData, TError> = | { status: "pending"; } | { data: TData; status: "done"; } | { error: TError; status: "error"; };Defined in: types.ts:157
The state of an atom that reads a promise
createAsyncAtom holds this shape. Read status first, and the compiler then gives
you data or error.
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | - |
TError | unknown |