-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0.0: Use Map internally for MapSchema #62
Comments
It would be a big plus to use // old
const player = players["one"];
// new
const player = players.get("one");
// old
players["one"] = player;
// new
players.set("one", player); |
Out of curiosity, use Map (or Set, also saw the other issue to include it), wouldn't affect performance over use Array? |
Hi @damian-pastorini, regarding performance only benchmarks can tell, but it should be very little difference by using one or another (Map, Set, or Array). I'll try to keep both syntaxes for maps so people upgrading won't feel much difference. When #75 lands, it should be possible to use either |
The
MapSchema
currently acts like a plain object in JavaScript, which lacks lots of useful methods that aMap
would provide.For version
1.0.0
, theMapSchema
should be re-structured to use aMap
, and implement all methods of theMap
structure: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/MapThe text was updated successfully, but these errors were encountered: