All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmAndroidMain.moe.tlaster.precompose.koin.Koin.jvmAndroid.kt Maven / Gradle / Ivy

There is a newer version: 1.7.0-alpha01
Show newest version
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