Skip to main content
cngx-src documentation

buildAsyncStateView

Functioncore/utils/async-state

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

Description#

Build a read-only CngxAsyncState<T> view from source signals.

All derived fields (isLoading, isPending, isEmpty, etc.) are computed() from the provided sources — the result is a consistent, single-source-of-truth state object that cannot become inconsistent.

This is the shared kernel used by all async state factories and state producers. No injection context required — uses only computed().

Signature#

buildAsyncStateView(sources: AsyncStateViewSources)

Parameters#

Returns#

CngxAsyncState