Incremental DOM implementation for legacy browsers.
- Zero dependencies, only 2.34kb (gzipped)
- Incremental DOM / Virtuial DOM
- Support for IE8+ and modern browsers
Install
$ npm install --save tiny-dream-es3 # Or use yarn $ yarn add --dev tiny-dream-es3
Tiny Usage
index.html
src/main.js
'app' App // initial renderingconst data = text: 'Hello World' // patch diff as if whole rendering
src/App.js (Component)
{ }
Example
For full examples, see example folder.
API
Only 7 APIs.
new TinyDream(id, component)
Initialize application by id.
tagOpen(tagName[, attributesArray, key])
Create open tag like <div>
.
The key
is used when searching and rendering lists for the best performance.
tagClose(tagName)
Create close tag like </div>
.
tagVoid(tagName[, attributesArray, key])
Create (empty) tag node like <input>
.
The key
is used when searching and rendering lists for the best performance.
text(text)
Create text node.
component(component, data)
Create custom component (and pass data).
patch(data)
Render whole incremental dom and patch only actual diffs to the real dom.