Skip to content

yiminghe/tree-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-diff

diff tree nodes like React.

NPM version build status Test coverage gemnasium deps npm download

Demo

http://yiminghe.github.io/tree-diff

Api

diff(fromNodes: any[], afterNodes : any[], options = {}): Patch

options.shouldUpdate(node1, node2, node1Index, node2Index)

decide whether change node1 to node2 or detroy node1 and recreate node2

options.childrenKey="children"

children member name if node type is object

patch(patcher: Patcher, operations)

for example: src/dom/patchDOM.js

operations.processNew

how to process new node

operations.processRemove

how to process node removal

operations.processMove

how to process node move

operations.processUpdate

how to process node update

About

diff tree nodes like React

Resources

Stars

Watchers

Forks

Packages

No packages published