-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Provide MainScope factory #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Let me add some more rationale here and additional suggestions. With this change an introduction to programming with coroutines for Android developers (see https://codelabs.developers.google.com/codelabs/kotlin-coroutines/index.html#4) could give the following example on "Controlling the UI with coroutines":
This gives the following benefits:
It would not have been this easy with Note the name of
This naming also plays nicely with the following pattern of using
|
We should provide factory method
fun MainScope() = CoroutineScope(Dispatchers.Main + SupervisorJob())
.It fixes multiple issues (especially with the #828):
async
behaviour when it is launched from UI componentThe text was updated successfully, but these errors were encountered: