Created
June 4, 2021 13:03
-
-
Save manuelvicnt/c2a36efa2516e8551addca8f7b3a3035 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
class ApplicationDiContainer { | |
// Scoped type. Same instance is always returned | |
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.Default) | |
// Unscoped type. Always returns a different instance | |
fun getMyRepository(): MyRepository { | |
return MyRepository(applicationScope) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment