Remove reflection from common module

This commit is contained in:
Alexander Nozik 2020-04-22 13:40:35 +03:00
parent 5e8e3014f7
commit 453a1bc755
3 changed files with 6 additions and 4 deletions

View File

@ -13,12 +13,12 @@ kotlin {
val commonMain by getting {
dependencies {
api(project(":dataforge-meta"))
api(kotlin("reflect"))
api("io.github.microutils:kotlin-logging-common:1.7.8")
}
}
val jvmMain by getting {
dependencies {
api(kotlin("reflect"))
api("io.github.microutils:kotlin-logging:1.7.8")
api("ch.qos.logback:logback-classic:1.2.3")
}

View File

@ -92,9 +92,11 @@ open class Context(
config.action()
}
override val coroutineContext: CoroutineContext = (parent ?: Global).coroutineContext.let { parenContext ->
override val coroutineContext: CoroutineContext by lazy {
(parent ?: Global).coroutineContext.let { parenContext ->
parenContext + SupervisorJob(parenContext[Job])
}
}
/**
* Detach all plugins and terminate context

View File

@ -14,7 +14,7 @@ data class MetaListener(
)
interface ObservableMeta : Meta {
fun onChange(owner: Any?, action: (Name, MetaItem<*>?, MetaItem<*>?) -> Unit)
fun onChange(owner: Any?, action: (name: Name, oldItem: MetaItem<*>?, newItem: MetaItem<*>?) -> Unit)
fun removeListener(owner: Any?)
}