import { render } from 'deleight/dom'
// create a template 1:
const items = it => it.map(num => ({li: [{}, num]}));
// create a template 2:
const footer = year => `<footer>© ${year}</footer>`;
// use templates:
const ul = render({
main: [
{}, // attributes
[ // children
// object form:
{ ul: [{ class: 'list1' }, items([1,2,3,4,5,6,7,8,9])] },
// text form:
footer(1991)
]
]
});
// reuse a template:
const ol = render({
ol: [{ class: 'list2' }, items([1,2,3,4,5,6,7,8,9,10])]
});
Render the IElement to text. Use on the server.