You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can already simplify its implementation in the following way:
class MyClass : CoroutineScope {
override val coroutineContext: CoroutineContext = Dispatchers.Main + Job()
}
Then, whenever you need to cancel a job, just use coroutineContext.cancel(). Does it help? Do we need to introduce any extra abstraction to ... ? It is already just one line.
Consider adding an interface
that simplifies the implementation of
CoroutineScope
.If this is considered useful, I would be glad to create a PR.
The text was updated successfully, but these errors were encountered: