Updated koin
This commit is contained in:
parent
f0a734fdab
commit
77470c7cfa
@ -74,7 +74,7 @@ dependencies {
|
||||
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
|
||||
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
|
||||
|
||||
def koin = "2.0.0-rc-2"
|
||||
def koin = "2.0.0-GA6"
|
||||
implementation "org.koin:koin-core:${koin}"
|
||||
implementation "org.koin:koin-android:${koin}"
|
||||
implementation "org.koin:koin-androidx-viewmodel:${koin}"
|
||||
|
@ -3,18 +3,15 @@ package com.topjohnwu.magisk.utils
|
||||
import org.koin.core.context.GlobalContext
|
||||
import org.koin.core.parameter.ParametersDefinition
|
||||
import org.koin.core.qualifier.Qualifier
|
||||
import org.koin.core.scope.Scope
|
||||
|
||||
fun getKoin() = GlobalContext.get().koin
|
||||
|
||||
inline fun <reified T : Any> inject(
|
||||
qualifier: Qualifier? = null,
|
||||
scope: Scope? = null,
|
||||
noinline parameters: ParametersDefinition? = null
|
||||
) = lazy { get<T>(qualifier, scope, parameters) }
|
||||
) = lazy { get<T>(qualifier, parameters) }
|
||||
|
||||
inline fun <reified T : Any> get(
|
||||
qualifier: Qualifier? = null,
|
||||
scope: Scope? = null,
|
||||
noinline parameters: ParametersDefinition? = null
|
||||
): T = getKoin().get(qualifier, scope, parameters)
|
||||
): T = getKoin().get(qualifier, parameters)
|
Loading…
Reference in New Issue
Block a user