doOnEmpty() Operator?
See original GitHub issueIs it possible we can add an Observable.doOnEmpty()
operator? Sometimes when I’m debugging or want to handle an empty Observable
I’d like to raise an error, display a message, or some other action to handle the emptiness…
Observable<String> source = ...
source.doOnEmpty(() -> System.out.println("No items were emitted!")).subscribe(System.out::println);
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Mono doOnEmpty in Reactor? - Stack Overflow
Is there any operator on Mono that would allow me to log fact that mono was empty? I cannot use hasElement() because I...
Read more >RxJava: Custom Operators - Mouaad Aallam
Lets create the custom doOnEmpty() operator: it will execute an Action when onComplete() is called and no emissions have occurred.
Read more >Implementing an ObservableOperator - Learning RxJava [Book]
Say, you want to create your own doOnEmpty() operator that will execute an Action when onComplete() is called and no emissions have occurred....
Read more >reactor/reactor - Gitter
It seems the last position of ':' in forwarded header is used to extract and parse the following sequence without a catch and...
Read more >Transformers (rxjava2-extras 0.1.38 API)
FlowableTransformer<T,T>, doOnEmpty(io.reactivex.functions.Action action) ... FlowableTransformer<T,Statistics> collectStats().
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh nice, that’s clever. And it doesn’t even require any custom Operator implementation.
I can go ahead and close this then. I’ve started using Kotlin with extension functions so it’s marginalized the need personally for me to put this in a centralized library.
Android is supported by JetBrains, Kotlin is not officially supported by Android. It’s nice but not everyone is using Kotlin in their projects.