0.0.3 • Published 4 years ago
dnjs2dom v0.0.3
dnjs client helper
For when you don't need all of mithril (this is currently 33 lines).
Usage:
<ul id="comments"></ul>
<script type="module">
import m from "https://unpkg.com/dnjs2dom@0.0.2/index.js"
const commentsEl = document.getElementById("comments")
const comments = [{text: "hiya!"}, {text: "oioi"}]
const ul = m("ul#foo.bar",
comments.map((comment, i) => m("li", `Comment ${i} says: ${comment.text}`))
)
m.setInner(commentsEl, m.makeEl(ul))
</script>