Rx.NET TakeUntil示例

时间:2017-03-31 20:00:12

标签: system.reactive

以下example

var subject = new Subject<int>();
var otherSubject = new Subject<Unit>();
subject    
.SkipUntil(otherSubject)
.Subscribe(Console.WriteLine, () => Console.WriteLine("Completed"));
subject.OnNext(1);
subject.OnNext(2);
subject.OnNext(3);
otherSubject.OnNext(Unit.Default);
subject.OnNext(4);
subject.OnNext(5);
subject.OnNext(6);
subject.OnNext(7);
subject.OnNext(8);
subject.OnCompleted();

产生输出

4
5
6
7
completed

它不应该发出值8吗?为什么它没有发出值8?

1 个答案:

答案 0 :(得分:3)