Δt DOM Adapter
This is an DOM Adapter for Δt.
It listen on the template events and writes to the DOM.
Installation
$ npm install dt-dom
How this Adapter works:
var domify = window.dynamictemplate.domify; // get the dom adapter
Just throw your template in and add it to the DOM when it's ready:
var tpl = ;tpl;
Documentation
domify(tpl)
tpl =
Expects a fresh Δt template instance (fresh means, instantiated in the same tick to prevent event loss).
It just simply listen for a bunch of events to manipulate the DOM.
Uses requestAnimationFrame for heavy DOM manipulation like node insertion and node deletion.
Overrides the query
method of the async XML Builder.
For query type text
it returns the result of textContent.
For query type attr
it returns the result of getAttribute.
For query type tag
it returns a dummy object that it will receive again on an add
event.