Concatenates an array of boolean values into a single boolean value based on the specified merge type.
example
// Concatenates an array of boolean values into a single boolean value based on logical AND
const input$: Observable<boolean[]> = of([true, false, true]);
Filters out consecutive emissions from the source observable that have the same serialized representation.
example
// Filters out consecutive emissions from the source observable
// that have the same serialized representation of an object with type User
const source$: Observable = from([
{ id: 1, name: 'test' },
{ id: 1, name: 'test' },
{ id: 1, name: 'test' }
]);
Filters the values emitted by the source observable based on the instance of specified types.
example
// Filters the values produced by the source observable based on an instance of the specified SomeClass instance type
const input$: Observable = from([1, 'string', { name: 'Some name' }, new SomeClass()]);
input$
.pipe(filterByInstanceOf(SomeClass))
Type Parameters
I
The type of instances to filter for in the source observable.
Conditionally applies a callback using the tap operator based on the specified condition.
example
// Displays a successful toast of saved settings if the value is greater than 10.
source$.pipe(..., tapOnCondition(value => value > 10, () => this.showSuccessToast()), ...)
Type Parameters
T
The type of the elements emitted by the source observable.
Parameters
condition: boolean | ((value: T) => boolean)
A function that determines the condition based on the emitted values.
callback: ((value: T) => void)
The callback function to be invoked when the condition is true.
(value: T): void
Parameters
value: T
Returns void
Returns OperatorFunction<T, T>
An operator that performs a side effect for each emission on the source observable.
Conditionally applies a callback using the tap operator based on the instance of specified types.
example
// Based on the values produced by the source observable,
// performs a side-effect only on an instance of the specified SomeClass type
const input$: Observable = from([1, 'string', { name: 'Some name' }, new SomeClass()]);
Concatenates an array of boolean values into a single boolean value based on the specified merge type.
// Concatenates an array of boolean values into a single boolean value based on logical AND const input$: Observable<boolean[]> = of([true, false, true]);
input$.pipe(concatBoolean('and')).subscribe((result: boolean) => { ... })