Now parses PromiseList and List
✨ In previous releases, lit-ntml
resolves everything for you under the hood including asynchronous tasks like Promises
, async
functions, etc. But it never actually resolves a PromiseList
or List
and that requires users to do explicit joining, like so:
const rendered = await html`<ul>${
[1,2,3].map(n => `<li>${n}</li>`).join('') // Explicit joining an array of items!
}</ul>`;
Now, lit-ntml
does everything for you:
const rendered = await html`<ul>${
[1,2,3].map(async n => html`<li>$[n}</li>`) // Now resolves `PromiseList` and `List`
}</ul>`;
Cheers 🍺 and have fun with HTML-templating! 🎉