Skip to content

Instantly share code, notes, and snippets.

@RBusarow
Created January 11, 2020 23:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RBusarow/2e79e15bb27347b8de811a91b5f4717e to your computer and use it in GitHub Desktop.
Save RBusarow/2e79e15bb27347b8de811a91b5f4717e to your computer and use it in GitHub Desktop.
@Qualifier
annotation class MainCoroutineScope
@Module
object CoroutineScopeModule {
@Provides
@MainCoroutineScope
fun provideMainCoroutineScope(): CoroutineScope = CoroutineScope(Job() + Dispatchers.Main)
}
class ProgressIndicator @Inject constructor(
@MainCoroutineScope
private val coroutineScope: CoroutineScope
) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment