Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bruceman/tvdom
A simple and fast tiny vdom tool
https://github.com/bruceman/tvdom
Last synced: 26 days ago
JSON representation
A simple and fast tiny vdom tool
- Host: GitHub
- URL: https://github.com/bruceman/tvdom
- Owner: bruceman
- License: mit
- Created: 2017-12-22T01:52:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T09:40:47.000Z (over 6 years ago)
- Last Synced: 2024-12-04T21:08:15.314Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 79.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
# tvdom
tvdom is a simple and fast tiny vdom tool that support parse html, diff vtree and patch to dom functions.### Sample
```js
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 '';Now time is :
' + date.toString() + '
}```
### How to build
> npm run build### Run test
> npm run test### See Also
- https://github.com/livoras/simple-virtual-dom
- https://github.com/HenrikJoreteg/html-parse-stringify