0.1.8 • Published 6 years ago

tvdom v0.1.8

Weekly downloads
14
License
MIT
Repository
github
Last release
6 years ago

tvdom

tvdom is a simple and fast tiny vdom tool that support parse html, diff vtree and patch to dom functions.

Sample

    var tpl = template(new Date());
    var container = document.getElementById('container');
    var tree = tvdom.parse(tpl);
    var dom = tree.render();
    container.append(dom);

    setInterval(function () {
        var newTpl = template(new Date());
        var newTree = tvdom.parse(newTpl);
        var patches = tvdom.diff(tree, newTree);
        tvdom.patch(dom, patches);
    }, 1000);

    function template(date) {
        return '<div><h2>Now time is :</h2><p class="time">' + date.toString() + '</p></div>';
    }

How to build

npm run build

Run test

npm run test

See Also

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago