> let tmpl = addresses => html`
> <table>
> ${addresses.forEach(address=>
> html`<tr>${address.first}</tr><tr>${address.last}</tr>`
> ).join('\n')
> }
> </table>`
>
> would be my guess? Similarly for the localization example
> in the blog post: arrow functions should make it relatively painless to make
> the template parameters explicit.
>
> Of course, building HTML from nested templates is not the
> same as filling a flat HTML template with user input, so I'm
> not sure what the implicit encoding of template parameters
> will do to this approach.
Nice. I’d let the html handler do the join, then it’s even shorter. That is: If
a substitution is an array of strings, it joins, otherwise it coerces to string.
--
Dr. Axel Rauschmayer
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss