-
-
Notifications
You must be signed in to change notification settings - Fork 116
History
Christian Alfoni edited this page Mar 5, 2015
·
4 revisions
var Baobab = require('baobab');
var store = new Baobab({
name: 'Maria'
}, {
maxHistory: 1
});
baobab.set('name', 'Isabella');
// On next frame, when update has been committed
baobab.get('name')
>>> 'Isabella'
baobab.undo();
baobab.get('name')
>>> 'Maria'
Related Methods
// Check whether our tree hold records
baobab.hasHistory();
>>> true
// Retrieving history records
baobab.getHistory();