From RxJS documentation for sample operator (Rxjs-sample), it says:
Whenever the notifier Observable emits a value or completes, sample looks at the source Observable and emits whichever value it has most recently emitted since the previous sampling, unless the source has not emitted anything since the previous sampling.
However, the following code does not seem to behave appropriately:
Rx.Observable.zip(
Rx.Observable.from(['Joe', 'Frank', 'Bob']),
Rx.Observable.interval(2000)
)
.sample(Rx.Observable.interval(2500))
.subscribe(console.log);
The output is as follows:
[ 'Joe', 0 ]
[ 'Frank', 1 ]
Why does the output not include ['Bob', 2]?