svelte-htm
Version:
tagged template syntax for svelte to simplify testing
19 lines (14 loc) • 477 B
JavaScript
import htm from 'htm';
import h from 'svelte-hyperscript';
import Fragment from 'svelte-fragment-component';
const html$ = htm.bind(h);
function html(...args) {
const component = html$(...args); // Multiple root elements (fragments): <div /><div />
if (Array.isArray(component)) {
// Wrap in a fragment: `component´ are its children
return h(Fragment, null, ...component);
}
return component;
}
export { html as default };
//# sourceMappingURL=html.js.map