I’m trying to make use of the init function on a DefineMap:
The output seems to do something weird with the input to the new Map(). You’ll see that the input argument is split into the individual characters in the console.
In my scenario I have an options type of structure that would be called using an object such as new Map({arg1: 'value-1'}). Was just trying to use a string as a shorthand for one of the options.
But not much of a worry always sending in the object.
By the looks of it then passing in a string is going to handle that string as an object which is why the characters are teased out.
To make this possible, DefineMap’s static setup (which gets called during .extend) would need to make sure that when it overwrites the prototype setup here:
I guess it might be worth the effort if you get more requests to do something like this; else maybe a warning when not passing in an object?
Anyway, I’ll go with the object for now so no worries from my end. Somehow I thought that the DefineMap worked that way and perhaps an older version did