-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support for maps, sets, and custom iterables in built-in "each" helper? #1418
Comments
Should be possible now, with #1557 |
@nknapp it appears that the implementation in #1557 doesn't support Also, it seems that expressions don't currently support |
With an addition in lookupProperty: function(parent, propertyName) {
if (parent instanceof Map) {
return parent.get(propertyName)
} Is there any appetite to add support like this? |
@karlvr I think your proposal is worth looking into. But I would like to discuss it. |
@karlvr could you start a new issue for Map support. Parts of this issue is already resolved and I would like to have a clean start. |
When using Handlebars in an ES6 environment, the built-in
each
helper's limitation of supporting only arrays and generic objects becomes inconvenient. To work around this, I started registering my own version of theeach
helper that supports arrays, maps, sets, custom iterables, and generic objects. That helper is below.Is there a plan or willingness to introduce support for these types of lists in the built-in
each
helper? I ask because I understand that Handlebars aims to avoid polyfills and I imagine that the only way of making the new helper work without compromising on browser support would be to progressively enable support for the different list types dependent on the environment's native or pre-polyfilled support forSet
,Map
, andSymbol
.The text was updated successfully, but these errors were encountered: