tornadofx2
tornadofx2 copied to clipboard
Split observableMapOf() into HashMap-based and LinkedHashMap-based
In Kotlin we have the next map-instantiation functions:
val kotlinMap = mapOf() // LinkedHashMap
val kotlinMutableMap = mutableMapOf() // LinkedHashMap
val kotlinHashMap = hashMapOf() // HashMap
And It would be great to have this in Tornadofx in order to keep coherence with Kotlin standard library:
val fxMap = observableMapOf() // now - HashMap, expected -LinkedHashMap
val fxHashMap = observableHashMapOf() // now - no such a function, expected - HashMap
It's definitely not a problem, but we are now used to it and I was expecting it exactly this way when used observable-instantiation functions first time. Now instantiating observable LinkedHashMap looks a bit boilerplating and doesn't meet neither Kotlin style nor Tornadofx's: LinkedHashMap<String, Int>().asObservable()
May be there are some reasons for that, but I just don't see any. Thank you!