Created
January 12, 2020 00:01
-
-
Save RBusarow/fcc1a9592142edf784e36859dfca6773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public fun MainCoroutineScope( | |
job: Job = SupervisorJob() | |
): MainCoroutineScope = object : MainCoroutineScope { | |
override val coroutineContext = job + Dispatchers.Main | |
} | |
public fun MainCoroutineScope( | |
context: CoroutineContext | |
): MainCoroutineScope = object : MainCoroutineScope { | |
override val coroutineContext = context + Dispatchers.Main | |
} | |
// repeat for the other dispatchers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment