Newer
Older
ToDoApp / app / src / main / java / keijumt / todoapp / di / DependencyInjector.kt
package keijumt.todoapp.di

import android.app.Application

object DependencyInjector {

    private lateinit var applicationComponent: AppComponent

    fun initialize(diApplication: Application): AppComponent {
        applicationComponent = DaggerAppComponent.builder()
                .application(diApplication)
                .build()
        return applicationComponent
    }

    fun applicationComponent(): AppComponent {
        return applicationComponent
    }
}