Skip to content

Instantly share code, notes, and snippets.

@Jswizzy
Created June 13, 2021 21:35
Show Gist options
  • Save Jswizzy/f1b62182d1dbbcb3737b610f3b2e8654 to your computer and use it in GitHub Desktop.
Save Jswizzy/f1b62182d1dbbcb3737b610f3b2e8654 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