Pablo
01/13/2021, 8:12 AMCoroutineScope
as a parameter with dagger like
fun provideFragmentScope(fragment: MyFragment): CoroutineScope = fragment.lifecycleScope
if on onDestroyView
I put lifecycleScope.coroutineContext.cancelChildren()
then is a good praxis to cancel coroutines? Note I'm not using ViewModel
so I have to cancel it manually...Lukas Sztefek
01/13/2021, 8:23 AMViewModel
. I recommend you to take a look at fragment.viewLifecycleOwner.lifecycleScope
. This lifecycle is slightly different then default one and might suit your needs better.Pablo
01/13/2021, 9:07 AMPablo
01/13/2021, 9:07 AMLukas Sztefek
01/13/2021, 9:08 AMPablo
01/13/2021, 9:30 AM