TangleGraph

object TangleGraph

Holds 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.

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
}

Functions

Link copied to clipboard
fun add(component: Any)

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

Link copied to clipboard
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
inline fun <T> get(): T

Used to retrieve a Component of a given type.

Link copied to clipboard
fun init(component: Any)

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

Link copied to clipboard
inline fun <T : Any> inject(target: T)

Performs member/field injection upon target using its bound scope.

Sources

Link copied to clipboard