Skip to content

Instantly share code, notes, and snippets.

@hkhc
Created October 1, 2018 15:14
Show Gist options
  • Select an option

  • Save hkhc/5e0aad9eb59e1e51bd5055dfe785982f to your computer and use it in GitHub Desktop.

Select an option

Save hkhc/5e0aad9eb59e1e51bd5055dfe785982f to your computer and use it in GitHub Desktop.
package myapp.di
import androidx.lifecycle.ViewModel
import dagger.Binds
import dagger.Module
import dagger.multibindings.IntoMap
import myapp.di.MyAppViewModel
import myapp.di.annotations.ViewModelKey
@Module
@Suppress("unused")
abstract class MyViewModelBuilder {
@Binds
@IntoMap
@ViewModelKey(MyAppViewModel::class)
internal abstract fun myappViewModel(viewModel: MyAppViewModel): ViewModel
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment