I'm having a utility function that converts a map into a list. It is supposed to still have the key values attached to it, but for some reason it doesn't. Rather I need to read of by index, of which is not really useful for my use case. Do someone know how to preserve keys when I transfer from a map? Here's my source
function getMetaStateArray(metaStateArrayOrObject) {
let metaStateArray;
if (metaStateArrayOrObject && Immutable.Map.isMap(metaStateArrayOrObject)) {
metaStateArray = metaStateArrayOrObject.toList();
}
else {
metaStateArray = metaStateArrayOrObject;
}
return metaStateArray;
}