💡 If you want only the last emission from multiple observables, on completion of multiple observables, try forkJoin!
( StackBlitz )
// RxJS v6+
import { of } from 'rxjs';
import { takeLast } from 'rxjs/operators';
const source = of('Ignore', 'Ignore', 'Hello', 'World!');
// take the last 2 emitted values
const example = source.pipe(takeLast(2));
// Hello, World!
const subscribe = example.subscribe(val => console.log(val));
- takeLast 📰 - Official docs
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/takeLast.ts