2017-03-31 81 views
1

以下exampleRx.NET TakeUntil例如

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?

+2

應該和我的機器上它。 – Shlomo

回答