Skip to content

readFrom() ​

Function

readFrom<T>(subject$: BehaviorSubject<T>): Read<T>

Create a new Read reading the state of a BehaviorSubject:

ts
const subjectState$: Read<string> = readFrom(behaviorSubject);

Source: lib/read-from.ts:17

Type parameters ​

ParameterDescription
Tstate used by the target

Parameters ​

ParameterTypeDescription
subject$BehaviorSubject<T>Query or BehaviorSubject to select from

Returns ​

Read<T>

Returns a new Read that emits the state of the BehaviorSubject