@json-lisp/dom
v0.1.1
Published
Native browser DOM renderer for JSON LISP documents.
Readme
@json-lisp/dom
Native browser DOM renderer for JSON LISP documents.
Install
npm install @json-lisp/domBrowser Usage
import { renderJsonLisp } from "@json-lisp/dom"
renderJsonLisp({
v: "0.1",
state: { count: 0 },
view: ["html.button", {
"@click": ["!set", "count", ["inc", ["$get", ["$state"], "count"]]]
}, [
"Count: ",
["text", ["$get", ["$state"], "count"]]
]]
}, {
target: document.getElementById("app")
})CDN Usage
<div id="app"></div>
<script type="module">
import { renderJsonLisp } from "https://cdn.jsdelivr.net/npm/@json-lisp/[email protected]/src/index.js"
renderJsonLisp({
v: "0.1",
state: { count: 0 },
view: ["html.button", {
"@click": ["!set", "count", ["inc", ["$get", ["$state"], "count"]]]
}, [
"Count: ",
["text", ["$get", ["$state"], "count"]]
]]
}, {
target: document.getElementById("app")
})
</script>See the full language manual:
https://github.com/Cause-of-a-Kind/json-lisp/blob/main/docs/manual.md
