Fast and light HTML templating without the render loop
npm install maik.h
maik started as a fork of
Rx.Observables as a new native 'primitive',
html and svg just like
lit-html, html and svg are lazy.
`
Or, old-school:
`
`
Basic Example
The API is really, really thin, so we just start off with another example.
`js
// Assume Rx and maik are globally available
let { bind, html } = maik
let clock = Rx.Observable.interval(1000).map(() =>
new Date().toLocaleTimeString()
)
// html partials are lazy, they don't do anything until you attach them.
// That basically means, the clock is not ticking right now.
let greeting = html
let theTime = html
let render = bind(document.body)
// We call render once, and the clock is ticking
render
`
Install it
`
npm install maik.h
`
like you always do and import it directly:
`
`
Features
* Maximally 3.8KB (minzipped).
* Uses ESM modules.
* Direct, native DOM manipulation. No VDOM.
* No framework, just a lib.
* Efficient for list of items. keyed` lists builtin.