KMap
A reactive key-value map.
Port of the useMap React hook.
val map = KMap<String, Int>()
map.set("apples", 3)
map.set("bananas", 5)
println(map.get("apples")) // 3
println(map.has("bananas")) // true
map.remove("apples")
map.clear()
// Observe reactively:
map.state.collect { snapshot -> render(snapshot) }Content copied to clipboard
Parameters
initialEntries
Key-value pairs to pre-populate the map.