Skip to content
Christian Alfoni edited this page Mar 13, 2015 · 2 revisions
var Baobab = require('baobab');

var tree = new Baobab({
  todos: {
    items: [],
    isLoading: false,
  },
  user: {
    name: 'Bob'
  }
});

tree.select('todos', 'items').edit([{title: 'foo'}]);

tree.select('todos', 'isLoading').edit(true);

tree.select('user').edit({name: 'Lars', age: 31});

// On update event
tree.select('todos').get();
>>> { items: [{title: 'foo'}], isLoading: true }

tree.select('user').get();
>>> { name: 'Lars', age: 31 }