Skip to content

Commit

Permalink
disable koinNavViewModel extra function, as it's same as normal VM co…
Browse files Browse the repository at this point in the history
…de in Compose
  • Loading branch information
arnaudgiuliani committed Dec 16, 2024
1 parent c1c2824 commit 11a4fbb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion projects/bom/koin-bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
api(project(":core:koin-core"))
api(project(":core:koin-core-coroutines"))
api(project(":core:koin-core-viewmodel"))
api(project(":core:koin-core-viewmodel-navigation"))
// api(project(":core:koin-core-viewmodel-navigation"))
api(project(":core:koin-test"))
api(project(":core:koin-test-junit4"))
api(project(":core:koin-test-junit5"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks.withType<KotlinCompile>().all {

dependencies {
api(project(":compose:koin-androidx-compose"))
api(project(":core:koin-core-viewmodel-navigation"))
// api(project(":core:koin-core-viewmodel-navigation"))
api(libs.androidx.composeNavigation)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.koin.core.annotation.KoinInternalApi
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
import org.koin.core.scope.Scope
import org.koin.viewmodel.defaultNavExtras
import org.koin.viewmodel.defaultExtras
import org.koin.viewmodel.resolveViewModel

/**
Expand All @@ -38,14 +38,15 @@ import org.koin.viewmodel.resolveViewModel
* @author Arnaud Giuliani
*/
@OptIn(KoinInternalApi::class)
@Deprecated("koinViewModel() can be used instead of koinNavViewModel(), as it's embedding nav backstack arguments")
@Composable
inline fun <reified T : ViewModel> koinNavViewModel(
qualifier: Qualifier? = null,
viewModelStoreOwner: ViewModelStoreOwner = checkNotNull(LocalViewModelStoreOwner.current) {
"No ViewModelStoreOwner was provided via LocalViewModelStoreOwner"
},
key: String? = null,
extras: CreationExtras = defaultNavExtras(viewModelStoreOwner),
extras: CreationExtras = defaultExtras(viewModelStoreOwner),
scope: Scope = currentKoinScope(),
noinline parameters: ParametersDefinition? = null,
): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kotlin {
sourceSets {
commonMain.dependencies {
api(project(":compose:koin-compose-viewmodel"))
api(project(":core:koin-core-viewmodel-navigation"))
// api(project(":core:koin-core-viewmodel-navigation"))
api(libs.jb.composeNavigation)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ import androidx.lifecycle.*
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import org.koin.compose.currentKoinScope
import org.koin.core.annotation.KoinExperimentalAPI
import org.koin.core.annotation.KoinInternalApi
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
import org.koin.core.scope.Scope
import org.koin.viewmodel.defaultNavExtras
import org.koin.viewmodel.defaultExtras
import org.koin.viewmodel.resolveViewModel

/*
Expand All @@ -43,15 +42,15 @@ import org.koin.viewmodel.resolveViewModel
* @author Arnaud Giuliani
*/
@OptIn(KoinInternalApi::class)
@KoinExperimentalAPI
@Deprecated("koinViewModel() can be used instead of koinNavViewModel(), as it's embedding nav backstack arguments")
@Composable
inline fun <reified T : ViewModel> koinNavViewModel(
qualifier: Qualifier? = null,
viewModelStoreOwner: ViewModelStoreOwner = checkNotNull(LocalViewModelStoreOwner.current) {
"No ViewModelStoreOwner was provided via LocalViewModelStoreOwner"
},
key: String? = null,
extras: CreationExtras = defaultNavExtras(viewModelStoreOwner),
extras: CreationExtras = defaultExtras(viewModelStoreOwner),
scope: Scope = currentKoinScope(),
noinline parameters: ParametersDefinition? = null,
): T {
Expand Down
2 changes: 1 addition & 1 deletion projects/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(
":core:koin-core",
":core:koin-core-coroutines",
":core:koin-core-viewmodel",
":core:koin-core-viewmodel-navigation",
// ":core:koin-core-viewmodel-navigation",
":core:koin-test",
":core:koin-test-junit4",
":core:koin-test-junit5",
Expand Down

0 comments on commit 11a4fbb

Please sign in to comment.