From 739857ca2de68dcc6b4808e462b57de613459102 Mon Sep 17 00:00:00 2001 From: stslex Date: Thu, 31 Oct 2024 20:21:15 +0300 Subject: [PATCH 1/2] refactor viewModel and store declaration --- .../ui/viewModel/ViewModelBean.android.kt | 37 +++++++++++++++++++ .../stslex/wizard/core/ui/mvi/StoreBean.kt | 36 ++++++++++++++++++ .../wizard/core/ui/viewModel/ViewModelBean.kt | 36 ++++++++++++++++++ .../core/ui/viewModel/ViewModelBean.ios.kt | 37 +++++++++++++++++++ .../feature/auth/di/ModuleFeatureAuth.kt | 10 +---- .../favourite/di/ModuleFeatureFavourite.kt | 11 +----- .../feature/film/di/ModuleFeatureFilm.kt | 10 +---- .../feature/film_feed/di/ModuleFeatureFeed.kt | 10 +---- .../follower/di/ModuleFeatureFollower.kt | 11 +----- .../feature/match/di/ModuleFeatureMatch.kt | 12 +----- .../feature/match/ui/store/MatchStore.kt | 2 +- .../match_feed/di/ModuleFeatureMatchFeed.kt | 10 +---- .../profile/di/ModuleFeatureProfile.kt | 11 +----- .../settings/di/ModuleFeatureSettings.kt | 10 +---- 14 files changed, 165 insertions(+), 78 deletions(-) create mode 100644 core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt create mode 100644 core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt create mode 100644 core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt create mode 100644 core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt diff --git a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt b/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt new file mode 100644 index 0000000..cf40401 --- /dev/null +++ b/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt @@ -0,0 +1,37 @@ +package com.stslex.wizard.core.ui.viewModel + +import androidx.lifecycle.ViewModel +import org.koin.androidx.viewmodel.dsl.viewModelOf +import org.koin.core.definition.BeanDefinition +import org.koin.core.definition.KoinDefinition +import org.koin.core.module.Module + +internal actual inline fun Module.viewModelOf( + crossinline constructor: () -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4, T5) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = viewModelOf(constructor, options) \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt new file mode 100644 index 0000000..512c78c --- /dev/null +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/mvi/StoreBean.kt @@ -0,0 +1,36 @@ +package com.stslex.wizard.core.ui.mvi + +import com.stslex.wizard.core.ui.viewModel.viewModelOf +import org.koin.core.definition.BeanDefinition +import org.koin.core.definition.KoinDefinition +import org.koin.core.module.Module + +inline fun > Module.storeOf( + crossinline constructor: () -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) + +inline fun , reified T1> Module.storeOf( + crossinline constructor: (T1) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) + +inline fun , reified T1, reified T2> Module.storeOf( + crossinline constructor: (T1, T2) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) + +inline fun , reified T1, reified T2, reified T3> Module.storeOf( + crossinline constructor: (T1, T2, T3) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) + +inline fun , reified T1, reified T2, reified T3, reified T4> Module.storeOf( + crossinline constructor: (T1, T2, T3, T4) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) + +inline fun , reified T1, reified T2, reified T3, reified T4, reified T5> Module.storeOf( + crossinline constructor: (T1, T2, T3, T4, T5) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition = viewModelOf(constructor, options) \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt new file mode 100644 index 0000000..94b8d54 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt @@ -0,0 +1,36 @@ +package com.stslex.wizard.core.ui.viewModel + +import androidx.lifecycle.ViewModel +import org.koin.core.definition.BeanDefinition +import org.koin.core.definition.KoinDefinition +import org.koin.core.module.Module + +internal expect inline fun Module.viewModelOf( + crossinline constructor: () -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition + +internal expect inline fun Module.viewModelOf( + crossinline constructor: (T1) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition + +internal expect inline fun Module.viewModelOf( + crossinline constructor: (T1, T2) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition + +internal expect inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition + +internal expect inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition + +internal expect inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4, T5) -> R, + noinline options: (BeanDefinition.() -> Unit)? = null, +): KoinDefinition \ No newline at end of file diff --git a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt b/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt new file mode 100644 index 0000000..03c8bd7 --- /dev/null +++ b/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt @@ -0,0 +1,37 @@ +package com.stslex.wizard.core.ui.viewModel + +import androidx.lifecycle.ViewModel +import org.koin.core.definition.BeanDefinition +import org.koin.core.definition.KoinDefinition +import org.koin.core.module.Module +import org.koin.core.module.dsl.factoryOf + +internal actual inline fun Module.viewModelOf( + crossinline constructor: () -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) + +internal actual inline fun Module.viewModelOf( + crossinline constructor: (T1, T2, T3, T4, T5) -> R, + noinline options: (BeanDefinition.() -> Unit)?, +): KoinDefinition = factoryOf(constructor, options) diff --git a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt index f4badf6..eef2ec6 100644 --- a/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt +++ b/feature/auth/src/commonMain/kotlin/com/stslex/wizard/feature/auth/di/ModuleFeatureAuth.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.auth.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.auth.data.AuthRepository import com.stslex.wizard.feature.auth.data.AuthRepositoryImpl import com.stslex.wizard.feature.auth.domain.AuthInteractor @@ -21,12 +21,6 @@ class ModuleFeatureAuth : AppModule() { factoryOf(::AuthRepositoryImpl) { bind() } factoryOf(::AuthInteractorImpl) { bind() } factoryOf(::AuthRouterImpl) { bind() } - storeDefinition { - AuthStore( - interactor = get(), - router = get(), - dispatcher = get() - ) - } + storeOf(::AuthStore) } } diff --git a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt index 7363817..68cbf8d 100644 --- a/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt +++ b/feature/favourite/src/commonMain/kotlin/com/stslex/wizard/feature/favourite/di/ModuleFeatureFavourite.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.favourite.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.favourite.data.repository.FavouriteRepository import com.stslex.wizard.feature.favourite.data.repository.FavouriteRepositoryImpl import com.stslex.wizard.feature.favourite.domain.interactor.FavouriteInteractor @@ -21,13 +21,6 @@ class ModuleFeatureFavourite : AppModule() { factoryOf(::FavouriteRepositoryImpl) { bind() } factoryOf(::FavouriteInteractorImpl) { bind() } factoryOf(::FavouriteRouterImpl) { bind() } - storeDefinition { - FavouriteStore( - interactor = get(), - appDispatcher = get(), - router = get(), - pagingFactory = get() - ) - } + storeOf(::FavouriteStore) } } diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt index 7fdb4a9..d1d1f48 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/di/ModuleFeatureFilm.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.film.data.repository.FilmRepository import com.stslex.wizard.feature.film.data.repository.FilmRepositoryImpl import com.stslex.wizard.feature.film.domain.interactor.FilmInteractor @@ -18,13 +18,7 @@ import org.koin.dsl.ModuleDeclaration class ModuleFeatureFilm : AppModule() { override fun declaration(): ModuleDeclaration = { - storeDefinition { - FilmStore( - interactor = get(), - appDispatcher = get(), - router = get(), - ) - } + storeOf(::FilmStore) factoryOf(::FilmRouterImpl) { bind() } factoryOf(::FilmInteractorImpl) { bind() } factoryOf(::FilmRepositoryImpl) { bind() } diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt index 174e149..c7a1a6b 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/di/ModuleFeatureFeed.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.film_feed.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.film_feed.data.repository.FeedRepository import com.stslex.wizard.feature.film_feed.data.repository.FeedRepositoryImpl import com.stslex.wizard.feature.film_feed.domain.interactor.FeedInteractor @@ -18,13 +18,7 @@ import org.koin.dsl.ModuleDeclaration class ModuleFeatureFeed : AppModule() { override fun declaration(): ModuleDeclaration = { - storeDefinition { - FeedStore( - interactor = get(), - appDispatcher = get(), - router = get() - ) - } + storeOf(::FeedStore) factoryOf(::FeedScreenRouterImpl) { bind() } factoryOf(::FeedInteractorImpl) { bind() } factoryOf(::FeedRepositoryImpl) { bind() } diff --git a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt index 5cf7bf6..41bea48 100644 --- a/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt +++ b/feature/follower/src/commonMain/kotlin/com/stslex/wizard/feature/follower/di/ModuleFeatureFollower.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.follower.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.follower.data.repository.FollowerRepository import com.stslex.wizard.feature.follower.data.repository.FollowerRepositoryImpl import com.stslex.wizard.feature.follower.domain.interactor.FollowerInteractor @@ -21,13 +21,6 @@ class ModuleFeatureFollower : AppModule() { factoryOf(::FollowerRepositoryImpl) { bind() } factoryOf(::FollowerInteractorImpl) { bind() } factoryOf(::FollowerRouterImpl) { bind() } - storeDefinition { - FollowerStore( - interactor = get(), - appDispatcher = get(), - router = get(), - pagerFactory = get(), - ) - } + storeOf(::FollowerStore) } } diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt index fb97ab1..20507dd 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/di/ModuleFeatureMatch.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.match.data.repository.MatchRepository import com.stslex.wizard.feature.match.data.repository.MatchRepositoryImpl import com.stslex.wizard.feature.match.domain.interactor.MatchInteractor @@ -21,14 +21,6 @@ class ModuleFeatureMatch : AppModule() { factoryOf(::MatchRepositoryImpl) { bind() } factoryOf(::MatchInteractorImpl) { bind() } factoryOf(::MatchRouterImpl) { bind() } - storeDefinition { - MatchStore( - interactor = get(), - router = get(), - appDispatcher = get(), - userStore = get(), - pagerFactory = get() - ) - } + storeOf(::MatchStore) } } diff --git a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt index b9764c4..afbee4f 100644 --- a/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt +++ b/feature/match/src/commonMain/kotlin/com/stslex/wizard/feature/match/ui/store/MatchStore.kt @@ -88,7 +88,7 @@ class MatchStore( updateState { currentState -> currentState.copy( isSelf = action.type == Screen.Match.Type.SELF, - uuid = action.uuid.ifBlank { userStore.uuid } , + uuid = action.uuid.ifBlank { userStore.uuid }, ) } diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt index ebef5c2..bc985f4 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/di/ModuleFeatureMatchFeed.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.match_feed.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.match_feed.data.repository.MatchFeedMockRepositoryImpl import com.stslex.wizard.feature.match_feed.data.repository.MatchFeedRepository import com.stslex.wizard.feature.match_feed.domain.MatchFeedInteractor @@ -21,12 +21,6 @@ class ModuleFeatureMatchFeed : AppModule() { factoryOf(::MatchFeedMockRepositoryImpl) { bind() } factoryOf(::MatchFeedInteractorImpl) { bind() } factoryOf(::MatchFeedRouterImpl) { bind() } - storeDefinition { - MatchFeedStore( - interactor = get(), - appDispatcher = get(), - router = get() - ) - } + storeOf(::MatchFeedStore) } } diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt index ce863dc..b2ea8f8 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/di/ModuleFeatureProfile.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.profile.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.profile.data.repository.ProfileRepository import com.stslex.wizard.feature.profile.data.repository.ProfileRepositoryImpl import com.stslex.wizard.feature.profile.domain.interactor.ProfileInteractor @@ -18,14 +18,7 @@ import org.koin.dsl.ModuleDeclaration class ModuleFeatureProfile : AppModule() { override fun declaration(): ModuleDeclaration = { - storeDefinition { - ProfileStore( - interactor = get(), - userStore = get(), - appDispatcher = get(), - router = get(), - ) - } + storeOf(::ProfileStore) factoryOf(::ProfileRouterImpl) { bind() } factoryOf(::ProfileInteractorImpl) { bind() } factoryOf(::ProfileRepositoryImpl) { bind() } diff --git a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt index b286848..3153cf3 100644 --- a/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt +++ b/feature/settings/src/commonMain/kotlin/com/stslex/wizard/feature/settings/di/ModuleFeatureSettings.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.feature.settings.di import com.stslex.wizard.core.core.AppModule -import com.stslex.wizard.core.ui.mvi.storeDefinition +import com.stslex.wizard.core.ui.mvi.storeOf import com.stslex.wizard.feature.settings.domain.SettingsInteractor import com.stslex.wizard.feature.settings.domain.SettingsInteractorImpl import com.stslex.wizard.feature.settings.navigation.SettingsRouter @@ -18,12 +18,6 @@ class ModuleFeatureSettings : AppModule() { override fun declaration(): ModuleDeclaration = { factoryOf(::SettingsInteractorImpl) { bind() } factoryOf(::SettingsRouterImpl) { bind() } - storeDefinition { - SettingsStore( - interactor = get(), - appDispatcher = get(), - router = get(), - ) - } + storeOf(::SettingsStore) } } \ No newline at end of file From 924a9f99b80de658f06d0bef6936830b64426185 Mon Sep 17 00:00:00 2001 From: stslex Date: Fri, 1 Nov 2024 22:48:57 +0300 Subject: [PATCH 2/2] fix vm visibility --- .../core/ui/viewModel/ViewModelBean.android.kt | 12 ++++++------ .../stslex/wizard/core/ui/viewModel/ViewModelBean.kt | 12 ++++++------ .../wizard/core/ui/viewModel/ViewModelBean.ios.kt | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt b/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt index cf40401..281ce92 100644 --- a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt +++ b/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.android.kt @@ -6,32 +6,32 @@ import org.koin.core.definition.BeanDefinition import org.koin.core.definition.KoinDefinition import org.koin.core.module.Module -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: () -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4, T5) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = viewModelOf(constructor, options) \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt index 94b8d54..26cd092 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.kt @@ -5,32 +5,32 @@ import org.koin.core.definition.BeanDefinition import org.koin.core.definition.KoinDefinition import org.koin.core.module.Module -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: () -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: (T1) -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: (T1, T2) -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3) -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4) -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition -internal expect inline fun Module.viewModelOf( +expect inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4, T5) -> R, noinline options: (BeanDefinition.() -> Unit)? = null, ): KoinDefinition \ No newline at end of file diff --git a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt b/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt index 03c8bd7..c6cff7b 100644 --- a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt +++ b/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/viewModel/ViewModelBean.ios.kt @@ -6,32 +6,32 @@ import org.koin.core.definition.KoinDefinition import org.koin.core.module.Module import org.koin.core.module.dsl.factoryOf -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: () -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options) -internal actual inline fun Module.viewModelOf( +actual inline fun Module.viewModelOf( crossinline constructor: (T1, T2, T3, T4, T5) -> R, noinline options: (BeanDefinition.() -> Unit)?, ): KoinDefinition = factoryOf(constructor, options)