Last active
August 31, 2020 09:01
-
-
Save peschee/e051c870a0354e4013d55351e6e8fe31 to your computer and use it in GitHub Desktop.
lit-html Count Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html, render } = from 'lit-html'; | |
// A lit-html template uses the `html` template tag: | |
const countTemplate = (count) => html`<p>The current count is: ${count}</p>`; | |
let i = 0; | |
setInterval(() => { | |
// Renders with the `render()` function | |
// + re-renders only update the data that changed, no VDOM diffing! | |
render(countTemplate(i++), document.body) | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://lit-html-example-unpkg.glitch.me