mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2025-11-17 03:40:06 +00:00
add caches
This commit is contained in:
16
common/src/commonMain/kotlin/UseCache.kt
Normal file
16
common/src/commonMain/kotlin/UseCache.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package dev.inmo.plaguposter.common
|
||||
|
||||
import org.koin.core.Koin
|
||||
import org.koin.core.module.Module
|
||||
import org.koin.core.qualifier.named
|
||||
import org.koin.core.scope.Scope
|
||||
|
||||
val Scope.useCache: Boolean
|
||||
get() = getOrNull(named("useCache")) ?: false
|
||||
|
||||
val Koin.useCache: Boolean
|
||||
get() = getOrNull(named("useCache")) ?: false
|
||||
|
||||
fun Module.useCache(useCache: Boolean) {
|
||||
single(named("useCache")) { useCache }
|
||||
}
|
||||
Reference in New Issue
Block a user