Created
January 14, 2021 03:48
-
-
Save raghunandankavi2010/d24707da8f9335febfa979e587daccfb to your computer and use it in GitHub Desktop.
rxjava equivalent in kotlin flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flow<String> { | |
// suspending call here | |
emit("Foo") | |
} | |
.onStart { // show loading } | |
.onCompletion { // hide loading } | |
.catch { // exception handling } | |
.onEach { // equivalent to rx onNext } | |
.launchIn(yourScope) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment