metal / metal.js

Build UI components in a solid, flexible way
http://metaljs.com
Other
229 stars 59 forks source link

Allow iterables, not just arrays, as child elements #389

Open blzaugg opened 6 years ago

blzaugg commented 6 years ago

This would allow mapping over any iterable (like Immutable.js) object, rather than having to convert those objects to arrays.

Code before:

{myList.map(
    // ...
).toArray()}

Code after:

{myList.map(
    // ...
)}

Pro:

React added this feature in v0.13.0: https://github.com/facebook/react/commit/c07ea0ba34df57fc54b218d6b4edcd090ed6411c

From Lee Byron (no relation) on avoiding conversion: https://twitter.com/leeb/status/746733697093668864?lang=en