Live Map
Like LiveVar, but for maps.
In other words, adding or removing to the map will cause the active section to rerender automatically.
For example:
val num2Names = liveMapOf(1 to "one", 2 to "two", 3 to "three")
section {
num2Names.forEach { (num, name) -> textLine("$num is spelled \"$name\"") }
}.run {
num2Names.putAll(mapOf(4 to "four", 5 to "five", 6 to "six"))
}
Content copied to clipboard
This class is thread safe and expected to be accessed across different threads.