Skip to content

Commit

Permalink
fix(di): use the correct dsl to create ViewModels.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Dec 22, 2023
1 parent f3ba7b6 commit 2ea9584
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.gdglille.devfest.android.theme.m3.partners.di.partnersModule
import org.gdglille.devfest.android.theme.m3.schedules.di.scheduleModule
import org.gdglille.devfest.android.theme.m3.speakers.di.speakersModule
import org.gdglille.devfest.repositoriesModule
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module

val mainModule = module {
Expand All @@ -21,6 +22,6 @@ val mainModule = module {
scheduleModule,
speakersModule
)
single { MainNavigationViewModel(get(), get()) }
single { MainViewModel(get()) }
viewModel { MainNavigationViewModel(get(), get()) }
viewModel { MainViewModel(get()) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package org.gdglille.devfest.android.theme.m3.partners.di
import org.gdglille.devfest.android.theme.m3.partners.feature.PartnerDetailViewModel
import org.gdglille.devfest.android.theme.m3.partners.feature.PartnersViewModel
import org.gdglille.devfest.repositoriesModule
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module

val partnersModule = module {
includes(repositoriesModule)
single { PartnersViewModel(get()) }
single { parametersHolder -> PartnerDetailViewModel(parametersHolder.get(), get()) }
viewModel { PartnersViewModel(get()) }
viewModel { parametersHolder -> PartnerDetailViewModel(parametersHolder.get(), get()) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package org.gdglille.devfest.android.theme.m3.speakers.di
import org.gdglille.devfest.android.theme.m3.speakers.feature.SpeakerDetailViewModel
import org.gdglille.devfest.android.theme.m3.speakers.feature.SpeakersListViewModel
import org.gdglille.devfest.repositoriesModule
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module

val speakersModule = module {
includes(repositoriesModule)
single { SpeakersListViewModel(get()) }
single { parameters -> SpeakerDetailViewModel(parameters.get(), get(), get()) }
viewModel { SpeakersListViewModel(get()) }
viewModel { parameters -> SpeakerDetailViewModel(parameters.get(), get(), get()) }
}

0 comments on commit 2ea9584

Please sign in to comment.