Created
September 14, 2018 15:04
-
-
Save ValeryPonomarenko/07199927af71f962a0668d48445b78ce to your computer and use it in GitHub Desktop.
Lifecycle aware dagger components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirstFragment : Fragment(), IHasComponent { | |
//code... | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
InjectionManager.instance.bindComponent<FirstFeatureComponent>(this).inject(this) | |
} | |
override fun getComponent(): FirstFeatureComponent = | |
DaggerFirstFeatureComponent.builder() | |
.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment