Closed canadaduane closed 4 years ago
Sure, I think that makes a lot of sense. The plan was always to mimic the JavaScript default types. So the argument should work exactly as defined by the EcmaScript spec. I expect that Map accepts any kind of iterable object.
I think i can work on this next week, but if anyone is interested this would also be a good first issue :)
Y.Map is nearly identical to Map in its method signatures. I've been using
new Map(Object.entries({ x, y z }))
as a way to initialize a regular Map, and thought it would be handy if this also worked for Y.Map:Without this parameter, I think the only way to set a Y.Map value is to call
set
multiple times:Another feature of the regular Map is the ability to merge values from two Maps on initialization:
Would it make sense to mimic this behavior for Y.Map also?
Huly®: YJS-159