AsyncSubject

Emits its last value on completion

Examples

Example 1: simple AsyncSubject

( Stackblitz )

// RxJS v6+
import { AsyncSubject } from 'rxjs';

const sub = new AsyncSubject();

sub.subscribe(console.log);

sub.next(123); //nothing logged

sub.subscribe(console.log);

sub.next(456); //nothing logged
sub.complete(); //456, 456 logged by both subscribers

Additional Resources


:file_folder: Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/AsyncSubject.ts

results matching ""

    No results matching ""