What's the best way to add multiple conditions to TakeUntil? Is it just a matter of chaining TakeUntil() calls to each other?
IObservable<MyClass> propertyToObserve = ...
var observable = propertyToObserve
.TakeUntil(SomeCondition)
.TakeUntil(OtherCondition)
.Subscribe(value => ...);
That is a reasonable way to do it. Another way is to merge the conditions:
source.TakeUntil(condition1.Merge(condition2))
.Subscribe(...);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With