add spruce.ts (also inlined into Spruce.newt)

This commit is contained in:
2026-04-04 08:03:23 -07:00
parent 949f1f2712
commit 5f721e455d
2 changed files with 121 additions and 4 deletions

View File

@@ -29,8 +29,7 @@ pfunc runApp : ∀ msg model. Element → model → (update : msg → model →
if (node) {
parent.insertBefore(child, node);
parent.removeChild(node);
}
else {
} else {
parent.appendChild(child);
}
return child;
@@ -47,8 +46,7 @@ pfunc runApp : ∀ msg model. Element → model → (update : msg → model →
let el;
if (node instanceof Element && node.tagName.toLowerCase() == vnode.h1) {
el = node;
}
else {
} else {
el = document.createElement(vnode.h1);
}
// update node here