Skip to content

Instantly share code, notes, and snippets.

@manuelvicnt
Created June 4, 2021 13:01
Show Gist options
  • Save manuelvicnt/43a075f2615c915cd11abdfbd2def086 to your computer and use it in GitHub Desktop.
Save manuelvicnt/43a075f2615c915cd11abdfbd2def086 to your computer and use it in GitHub Desktop.
class MyRepository(private val externalScope: CoroutineScope) { /* ... */ }
class MyApplication : Application() {
// Application-scoped types that any class in the app could access
// using the applicationContext.
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
val myRepository = MyRepository(applicationScope)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment