https://kotlinlang.org logo
#android
Title
# android
f

frankelot

07/08/2021, 10:46 PM
Is it possible to specify the underlaying
Map
implementation of
mutableStateMapOf()
?
I need to use “ordered by injection” map (aka LinkedHashMap)
I guess can always use a
MutableStateFlow(LinkedHashMap<String, String>())
but I was suggested to favor
mutableStateMapOf
whenever possible
z

Zach Klippenstein (he/him) [MOD]

07/08/2021, 11:14 PM
No, it uses the kotlinx.immutable map implementation internally. I thought that map preserved insertion order too but I can’t remember for sure
3 Views