Closed
Description
Example:
var v = Immutable.Vector(1, 2, 3)
v.toString() // "Vector [ 1, 2, 3 ]"
var v2 = v.map(function (x) { return x + 1; })
v2.toString() // "Seq [ 2, 3, 4 ]"
v2.delete(0) // TypeError: undefined is not a function
So, one must issue toVector()
after the transformation to get original structure type back. This is very inconvenient for a library user.
I understand this is due to laziness so possible options may be:
- provide strict versions of
map/filter/etc
; - somehow preserve set of methods and observable behavior of the original data structure;
- provide single method replacing
toVector/toMap/etc
and allowing to get original data structure after transformation back, e.g.force()
; - ...
Metadata
Metadata
Assignees
Labels
No labels