commonMain.org.koin.ext.InjectProperty.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of koin-core-js Show documentation
Show all versions of koin-core-js Show documentation
KOIN - Kotlin simple Dependency Injection Framework
package org.koin.ext
import org.koin.core.Koin
import org.koin.core.scope.Scope
import org.koin.mp.KoinPlatformTools
import kotlin.reflect.KMutableProperty0
inline fun KMutableProperty0.inject() {
set(KoinPlatformTools.defaultContext().get().get())
}
inline fun KMutableProperty0.inject(koin: Koin) {
set(koin.get())
}
inline fun KMutableProperty0.inject(scope: Scope) {
set(scope.get())
}