Created
October 17, 2019 20:13
-
-
Save joaortk/40f8f9aaaf0d3531ccb58441008bf7fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider | |
import com.test.simpleapp.common.ViewModelFactory | |
import com.test.simpleapp.common.ViewModelKey | |
import dagger.Binds | |
import dagger.Module | |
import dagger.multibindings.IntoMap | |
@Module | |
abstract class ViewModelModule { | |
@Binds | |
internal abstract fun bindViewModelFactory(factory: ViewModelFactory): ViewModelProvider.Factory | |
@Binds | |
@IntoMap | |
@ViewModelKey(MyViewModel::class) | |
internal abstract fun bindMyViewModel(viewModel: MyViewModel): ViewModel | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment