BaobabJavaScript 树型数据结构
Baobab 是一个 JavaScript 树型数据结构,支持游标。
示例代码:
var Baobab = require('baobab'); var tree = new Baobab({ palette: { colors: ['yellow', 'purple'], name: 'Glorious colors' } }); var colorsCursor = tree.select('palette', 'colors'); colorsCursor.on('update', function() { console.log('Selected colors have updated:', colorsCursor.get()); }); colorsCursor.push('orange');
评论