Learn RxJS
Search…
AsyncSubject

Emits its last value on completion

Examples

Example 1: simple AsyncSubject

1
// RxJS v6+
2
import { AsyncSubject } from 'rxjs';
3
4
const sub = new AsyncSubject();
5
6
sub.subscribe(console.log);
7
8
sub.next(123); //nothing logged
9
10
sub.subscribe(console.log);
11
12
sub.next(456); //nothing logged
13
sub.complete(); //456, 456 logged by both subscribers
Copied!

Additional Resources

Last modified 7mo ago