You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Record.fromEntries is explicitly restricted to only coercing from 2-tuples of values. This is inconsistent with basically every other native type, which accept iterables of iterables, and it only takes the first 2 values of the inner iterable. Also, for the purposes of this, the inner pairs don't really need to be immutable, as you'd need to pull the keys and values out anyways because the key needs coerced to a string and because engines aren't going to want to store it as a list of literal key/value pairs directly - it's only efficient to iterate.
The text was updated successfully, but these errors were encountered:
Which native type accepts an iterable of iterables? Map and WeakMap accept an iterable of "arraylikes of length 2", and throw if it's something else; Set and WeakSet accept an iterable of values…
Oh, okay. Didn't remember that specific with maps, weak maps, and Object.fromEntries. (I'm referring to those specifically.) But still, the restriction with Record.fromEntries seems arbitrary.
Record.fromEntries
is explicitly restricted to only coercing from 2-tuples of values. This is inconsistent with basically every other native type, which accept iterables of iterables, and it only takes the first 2 values of the inner iterable. Also, for the purposes of this, the inner pairs don't really need to be immutable, as you'd need to pull the keys and values out anyways because the key needs coerced to a string and because engines aren't going to want to store it as a list of literal key/value pairs directly - it's only efficient to iterate.The text was updated successfully, but these errors were encountered: