Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Wrong OnCompleted timing of ZipObservable #537

Open
ymfact opened this issue Nov 29, 2023 · 0 comments
Open

Wrong OnCompleted timing of ZipObservable #537

ymfact opened this issue Nov 29, 2023 · 0 comments

Comments

@ymfact
Copy link

ymfact commented Nov 29, 2023

ZipObservable has wrong OnCompleted timing.

var source1 = new Subject<int>();
var source2 = new Subject<char>();
var observable = Observable.Zip(source1, source2, (x, y) => $"{x}{y}");
observable.Subscribe(
    onNext: Console.WriteLine,
    onCompleted: () => Console.WriteLine("OnCompleted"));
source1.OnNext(1);
source2.OnNext('A');
source1.OnNext(2);
source2.OnNext('B');
source2.OnNext('C');
source2.OnNext('D');
source1.OnNext(3);
source2.OnCompleted();
source1.OnNext(4); // observable should be completed here
source1.OnNext(5); // observable is completed here in UniRx
source1.OnCompleted();

reference:
zipzip

https://rxmarbles.com/#zip

var source1 = new Subject<int>();
var source2 = new Subject<char>();
var observable = Observable.Zip(source1, source2, (x, y) => $"{x}{y}");
observable.Subscribe(
    onNext: Console.WriteLine,
    onCompleted: () => Console.WriteLine("OnCompleted"));
source1.OnNext(1);
source2.OnNext('A');
source1.OnNext(2);
source2.OnNext('B');
source1.OnNext(3);
source2.OnNext('C');
source1.OnCompleted(); // observable should be completed here
source2.OnCompleted(); // observable is completed here in UniRx

reference:
zip

https://reactivex.io/documentation/operators/zip.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant