RxJava — Practical takeUntil Example
Niklas Baudy

Nice use case, although you can make it even shorter if I’m right, by using `firstOrDefault()` with predicate. It will take the first one for which predicate evaluates to `true` or use the provided default value if observable is complete without any emitted item satisfying the predicate.

This way `takeUntil()` and `lastOrDefault()` become one `firstOrDefault()` call.

Like what you read? Give Ivan Škorić a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.