Skip to main content
cngx-src documentation

InjectAsyncStateOptions

Interface

projects/common/data/async-state/inject-async-state.ts

Import#

import { InjectAsyncStateOptions } from '@cngx/common/data'

Description#

Configuration options for injectAsyncState.

Index#

Instance Properties#

debounce#number
Optional

Debounce time in ms for signal dependency changes. Coalesces rapid changes into one state transition and one consumed result. Note: a promise-returning fn still runs once per change - the invocation is what tracks its signals - but only the freshest capture is consumed; superseded captures are observed and discarded. Cold Observables cost nothing until subscribed, so for them the debounce fully prevents request storms.

label#string
Optional

Human-readable label surfaced in CngxAsyncRegistry.activeOperations. Display only - never the registry key. Ignored unless register is set.

register#boolean
Optional

When true, register this state in the ambient CngxAsyncRegistry (if one is provided via provideAsyncRegistry()) for the injector's lifetime, and unregister automatically on destroy. Defaults to false - a no-op for existing callers, and a no-op when no registry is provided.