Skip to main content
cngx-src documentation

AsyncStateViewSources

Interface

projects/core/utils/build-async-state-view.ts

Import#

import { AsyncStateViewSources } from '@cngx/core/utils'

Description#

Source signals for building a read-only async state view.

Index#

Instance Properties#

data#Signal
Readonly

The most recent successful result.

error#Signal
Readonly

The most recent error.

isEmpty#Signal
ReadonlyOptional

Whether the state is empty. Defaults to a shape-derived computed that treats null/undefined and empty arrays as empty - correct for every data-carrying producer. Aggregates whose emptiness cannot be read off the data shape (an N-element array is never length 0) pass their own signal.

isFirstLoad#Signal
ReadonlyOptional

Whether the first successful load has not yet completed. Defaults to computed(() => false) when omitted - appropriate for mutation producers that never show a skeleton. Query producers should pass computed(() => !hadSuccess()).

lastUpdated#Signal
ReadonlyOptional

Timestamp of the last successful load.

progress#Signal
ReadonlyOptional

Progress 0–100, or undefined for indeterminate.

status#Signal
Readonly

Single source of truth - the current status.