Suppose I have the following code:
let a = Rx.Observable.of(1, 2, 3) let b = Observable.zip(a, a, (a, b) => a + b) b.forEach(t => console.log(t))
This immediately displays the results. Now, how to set the time delay between each message as a backpressure method (note that I do not want to use a buffer, instead I want a and b become Cold observables ), for example:
b.takeEvery(1000).forEach(t => console.log(t))
And get the same answer:
<wait 1s> 2 <wait 1s> 4 <wait 1s> 6
Alternative: If backpressure (output mechanisms for some observables) is not supported in RxJS, then how can you create an infinite generator without running out of resources?
Alternative 2: Other JS frameworks that support pull and push mechanisms
javascript observable rxjs rxjs5 reactivex
Hugo sereno ferreira
source share