SingleIn

A Scope that uses a given scope key value to indicate what scope the annotated type is a singleton in.

Example:

@DependencyGraph(AppScope::class)
interface AppGraph {
@SingleIn(AppScope::class)
@Provides
fun provideHttpClient(): HttpClient = HttpClient()
}

This is a Repeatable annotation to declare multiple scopes on dependency graphs, as long as each annotation declares a different scope.

See also

for an out-of-the-box application-wide key.

Properties

Link copied to clipboard
val scope: KClass<*>