Hot fix for observable meta wrapper

This commit is contained in:
Alexander Nozik 2024-02-06 10:21:05 +03:00
parent 78641f6f87
commit 0e5a31db9f
2 changed files with 4 additions and 2 deletions

View File

@ -15,9 +15,9 @@ private class ObservableMetaWrapper(
val listeners: MutableSet<MetaListener>, val listeners: MutableSet<MetaListener>,
) : ObservableMutableMeta { ) : ObservableMutableMeta {
override val items: Map<NameToken, ObservableMutableMeta> override val items: Map<NameToken, ObservableMutableMeta>
get() = root.items.keys.associateWith { get() = root[nodeName]?.items?.keys?.associateWith {
ObservableMetaWrapper(root, nodeName + it, listeners) ObservableMetaWrapper(root, nodeName + it, listeners)
} } ?: emptyMap()
override fun get(name: Name): ObservableMutableMeta? = if (root[nodeName + name] == null) { override fun get(name: Name): ObservableMutableMeta? = if (root[nodeName + name] == null) {
null null

View File

@ -17,6 +17,8 @@ class ObservableMetaTest {
} }
}.asObservable() }.asObservable()
println(meta)
assertEquals("scatter", meta["data.type"].string) assertEquals("scatter", meta["data.type"].string)
} }