Skip to main content

reactiveSubtract

Alternatives: sub$$, subtract$$

Types

function reactiveSubtract(
a: IObservable<number>,
b: IObservable<number>,
): IObservable<number>

Definition

Creates an Observable which performs a subtraction (-) between the values sent by two Observables, and emits the result.

Diagram

Perform the "subtraction" of two Observables

const subscribe = reactiveSubtract(
single(10),
single(5),
);

subscribe((value: number) => {
console.log(value);
});

Output:

5