∺ Hingejs
HTML Marker
HTML Marker is used to update string literal values without re-rendering
any HTML. Child nodes are supported but will not mark string literals
that are a child of a custom element
Sample code
import { HtmlMarker } from 'https://cdn.jsdelivr.net/npm/@hingejs/services/index.min.js'
(async () => {
let model = { id: new Date().getTime(), test: 'this is a test' }
const htmlMarker = new HtmlMarker(model)
const htmlString = '<p id="${id}">${test}</p>'
await htmlMarker.render(document.body, htmlString)
window.setInterval(() => {
model = { test: new Date().getTime() }
htmlMarker.updateModel(model)
}, 1000)
})()
Working sample