tc39 / proposal-await-dictionary

A proposal to add Promise.ownProperties(), Promise.fromEntries() to ECMAScript
MIT License
86 stars 4 forks source link

Consider a Map analogue? #11

Closed ajvincent closed 1 year ago

ajvincent commented 1 year ago

Note: I'm only filing this for discussion purposes, not necessarily because I think it's a good idea. Specifically, the "Q&A" part of the README implies we looked at Map - which we did two years ago, but we haven't captured anywhere in the proposal text.

ljharb commented 1 year ago

Based on the discussion in the array grouping proposal, I think it's pretty clear and understood that objects are more ergonomic, and that Map only comes into play when there's a distinct advantage from using it. Since the ergonomic goal here is for object destructuring, which doesn't work with Maps, I think there's just no direction here to go.

ajvincent commented 1 year ago

Then maybe we just need to update the Q&A section.