mercury
Version:
A truly modular frontend framework
40 lines (26 loc) • 748 B
Markdown
Auto generated from [virtual-dom](https://github.com/Matt-Esch/virtual-dom) package (version 1.3.0).
A realtime tree diffing algorithm
`vtree` currently exists as part of `virtual-dom`. It is used for imitating
diff operations between two `vnode` structures that imitate the structure of
the active DOM node structure in the browser.
```js
var h = require("virtual-dom/h")
var diff = require("virtual-dom/diff")
var leftNode = h("div")
var rightNode = h("text")
var patches = diff(leftNode, rightNode)
/*
-> {
a: lefNode,
0: vpatch<REPLACE>(rightNode) // a replace operation for the first node
}
*/
```
`npm install virtual-dom`
- Matt Esch