RxJS version:
rxjs@5.0.0-rc.1
Code to reproduce:
let subject = new Rx.ReplaySubject();
subject.next(1);
subject.subscribe(function (data) {
console.log(data);
if (data < 3) { data++; subject.next(data); }
});
Expected behavior:
Output: 1, 2, 3
Actual behavior:
Output: 1
Additional information:
This works properly in RxJS v4
It seems that the issue comes from this code: https://github.com/ReactiveX/rxjs/blob/master/src/ReplaySubject.ts#L40
Where we first call the subsrcibe handler with the previous values, before we actually subscribe him for next values.