package com.phapps.elitedangerous.companion.di

import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import com.phapps.elitedangerous.companion.viewmodels.EdcAuthenticationViewModel
import com.phapps.elitedangerous.companion.viewmodels.GalNetArticlesViewModel
import com.phapps.elitedangerous.companion.viewmodels.ProfileViewModel
import com.phapps.elitedangerous.companion.viewmodels.ViewModelFactory
import dagger.Binds
import dagger.Module
import dagger.multibindings.IntoMap

@Module
abstract class ViewModelModule {
    @Binds
    @IntoMap
    @ViewModelKey(EdcAuthenticationViewModel::class)
    abstract fun bindEdcAuthViewModel(viewModel: EdcAuthenticationViewModel): ViewModel

    @Binds
    @IntoMap
    @ViewModelKey(ProfileViewModel::class)
    //    @Singleton
    //    @Provides
    abstract fun bindProfileViewModel(viewModel: ProfileViewModel): ViewModel

    @Binds
    @IntoMap
    @ViewModelKey(GalNetArticlesViewModel::class)
    //    @Singleton
    //    @Provides
    abstract fun bindGalNetArticlesViewModel(viewModel: GalNetArticlesViewModel): ViewModel

    @Binds
    //    @Provides
    abstract fun bindViewModelFactory(factory: ViewModelFactory): ViewModelProvider.Factory
}
