Created
March 17, 2019 23:43
-
-
Save RBusarow/c96b37c3856c5cb9966ee9038e67816c to your computer and use it in GitHub Desktop.
Simple factory for creating an implementation of a CoroutineScope using a SupervisorJob
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
fun SupervisorCoroutineScope( | |
dispatcher: CoroutineDispatcher | |
): CoroutineScope = object : CoroutineScope { | |
override val coroutineContext: CoroutineContext | |
get() = SupervisorJob() + dispatcher | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment