jvmAndroidMain.moe.tlaster.precompose.koin.Koin.jvmAndroid.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of precompose-koin Show documentation
Show all versions of precompose-koin Show documentation
PreCompose Koin intergration
package moe.tlaster.precompose.koin
import androidx.compose.runtime.Composable
import moe.tlaster.precompose.stateholder.LocalStateHolder
import moe.tlaster.precompose.stateholder.StateHolder
import moe.tlaster.precompose.viewmodel.ViewModel
import org.koin.compose.LocalKoinScope
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
import org.koin.core.scope.Scope
@Composable
inline fun koinViewModel(
qualifier: Qualifier? = null,
stateHolder: StateHolder = checkNotNull(LocalStateHolder.current) {
"No StateHolder was provided via LocalStateHolder"
},
key: String? = null,
scope: Scope = LocalKoinScope.current,
noinline parameters: ParametersDefinition? = null,
): T {
return koinViewModel(
T::class,
qualifier,
stateHolder,
key,
scope,
parameters,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy