javascript - Maintaining Key values when converting from Map to List ImmutableJS -
i'm having utility function converts map list. supposed still have key values attached it, reason doesn't. rather need read of index, of not useful use case. know how preserve keys when transfer map? here's source
function getmetastatearray(metastatearrayorobject) { let metastatearray; if (metastatearrayorobject && immutable.map.ismap(metastatearrayorobject)) { metastatearray = metastatearrayorobject.tolist(); } else { metastatearray = metastatearrayorobject; } return metastatearray; }
solved making list wrapper around map, while doing list.of()
inside wrapper, map inside won't turn regular array:
metastatearray = list(list.of(metastatearrayorobject));
Comments
Post a Comment