Is it okay when you pass coroutine scope in the co...
# coroutines
h
Is it okay when you pass coroutine scope in the constructor parameters for classes without lifecycles?For example a paged list data source then, use factory class to add the parameters to the data source class, then handle the lifecycle of the coroutine in a view model or fragment/activity
s
In general, that's only a good idea if those classes have an (implicit) lifecycle that is the same as the Fragment/Activity's. If not, pass the coroutine scope as either the first parameter or as second receiver to methods on those classes.
h
The classes have no (implicit) lifecycle, the second option will work then on this case.Thanks