https://kotlinlang.org logo
Title
m

Mikołaj Kąkol

03/10/2020, 4:58 PM
is there an easy way to have a`scope` that would cancel job in
onStop
. I'm thinking of equivalent of: https://github.com/trello/RxLifecycle So I would like start
Flow
in
onStart
and have it canceled by
onStop
. From what I see
LifecycleCoroutineScope
has only option to cancel it on destroy
j

Javier Troconis

03/10/2020, 5:03 PM
Using lifecycle aware components and creating a scope inside seems the most direct way. That's what the library you're pointing seems to use in the android specific case
m

Mikołaj Kąkol

03/10/2020, 5:30 PM
I'm not sure what you propose. I know it's android lib, it's #android 🙂 I would like to have something similar from Rx in coroutines