Created
June 4, 2021 13:07
-
-
Save manuelvicnt/67583b98b5af9e7f1c4bc61452320879 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @InstallIn(SingletonComponent::class) | |
| @Module | |
| object CoroutinesScopesModule { | |
| @Singleton // Provide always the same instance | |
| @Provides | |
| fun providesCoroutineScope(): CoroutineScope { | |
| // Run this code when providing an instance of CoroutineScope | |
| return CoroutineScope(SupervisorJob() + Dispatchers.Default) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment