observeAgentState
Unpublished development API. This package is under development and is not available as a published release.
Observe the application state of an app-owned session in an injection context. The signal changes only when the state changes, not on every streamed token.
The type comes from the session: a session created with a stateType yields
that type, read-only, and any other yields plain data. The value is
undefined until the session holds a state.
Pass select to read one part of the state. select runs once per state,
and the signal changes only when the selected value does.
import { observeAgentState } from '@threadplane/angular';Declaration · overload 1
export declare function observeAgentState<TState>(session: StateSession<TState>): Signal<TState | undefined>;Type parameters
TState
Parameters
session· requiredStateSession<TState>
Returns
Signal<TState | undefined>Declaration · overload 2
export declare function observeAgentState<TState, TSelected>(session: StateSession<TState>, select: (state: TState | undefined) => TSelected): Signal<TSelected>;Type parameters
TStateTSelected
Parameters
session· requiredStateSession<TState>select· required(state: TState | undefined) => TSelected
Returns
Signal<TSelected>