init

fun init(component: Any)

Sets a reference to the application's Dagger graph, so that it can be accessed by internal tooling.

This should be initialized as soon as possible after initializing the AppComponent.

This function has been renamed to add. This "init" version will be removed soon.

Since

0.10.0

Samples

import tangle.inject.TangleGraph
import tangle.inject.test.utils.Application
import tangle.inject.test.utils.DaggerAppComponent
import tangle.inject.test.utils.Sample
fun main() { 
   //sampleStart 
   class MyApplication : Application() {

  override fun onCreate() {
    super.onCreate()

    val appComponent = DaggerAppComponent.factory()
      .create(this)

    TangleGraph.add(appComponent)
  }
} 
   //sampleEnd
}

Parameters

component

the application-scoped Dagger component

Sources

Link copied to clipboard