//emit one item
const example = Rx.Observable.of(null);
//delay output of each by an extra second
const message = Rx.Observable.merge(
example.mapTo('Hello'),
example.mapTo('World!').delay(1000),
example.mapTo('Goodbye').delay(2000),
example.mapTo('World!').delay(3000)
);
//output: 'Hello'...'World!'...'Goodbye'...'World!'
const subscribe = message.subscribe(val => console.log(val));
- delay 📰 - Official docs
- Transformation operator: delay and delayWhen 📹 💵 - André Staltz
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/operator/delay.ts