Mooorph
An agnostic tree morpher
Basic Usage
const Morph = const a = name:'world' children: name:'hero'x:100y:100 name:'coin'x:20y:30 const b = name:'world' children: name:'hero'x:100y:100 name:'coin'x:20y:30 name:'coin'x:20y:30 name:'dog'x:20y:50 // a deep equal b && a === Morph(a,b)
API
Morph :: (oldTree, newTree, options={}) => oldTree:Tree
options.childrenKey = 'children' options.isSame = (oldNode, newNode)=>boolean options.morph = (oldNode, newNode, oldParent, index)=>undefined options.remove = (oldNode, newNode, oldParent, index)=>undefined options.create = (oldNode, newNode, oldParent, index)=>undefined options.replace = (oldNode, newNode, oldParent, index)=>undefined