Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pencelab/d52bb01fc246f61744b50c0a946c8497 to your computer and use it in GitHub Desktop.
Save pencelab/d52bb01fc246f61744b50c0a946c8497 to your computer and use it in GitHub Desktop.
val myRepository = MyRepository()
val myComponent = MyComponent(myRepository)
...
val job = launch {
delay(1250)
myComponent.mySharedFlow
.onStart {
log("Collector started collecting...")
}
.collect {
log("Collected => $it")
delay(600)
}
}
val fetcher = myComponent.fetchAndEmitList()
fetcher.join()
myComponent.release()
delay(2500)
job.cancel()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment