atomico
Version:
Atomico is a small library for the creation of interfaces based on web-components, only using functions and hooks.
18 lines (13 loc) • 384 B
JavaScript
import { createElement } from "../src/core.js";
import { build, evaluate } from "htm/src/build.mjs";
const CACHE = new Map();
export function html(statics) {
let tmp = CACHE;
tmp = evaluate(
createElement,
tmp.get(statics) || (tmp.set(statics, (tmp = build(statics))), tmp),
arguments,
[]
);
return tmp.length > 1 ? tmp : tmp[0];
}