1.0.1 • Published 8 years ago
conbo-changehistory v1.0.1
ChangeHistory for ConboJS 4
The ChangeHistory class is a simple object state history manager for ConboJS that enables you to navigate back and forward through the history of every property change made to any object that extends the EventDispatcher class, including Hash, Application and View, effectively making it possible to return to any of an object's past states.
The ChangeHistory class can be imported as an AMD, CommonJS or global module.
API
The ChangeHistory class is modelled on the built-in browser History class, offering the following properties and methods:
back()moves back 1 step into historyforward()moved forward 1 step in hisyorygo(n)movesnsteps backwards or forwards in historycurrentIndexis the current place in historybeforeFirstindicates whether you are at a point in history before any changes were madeatLastindicates that you are at the end of history
Getting started
Initialising ChangeHistory for an object couldn't be easier:
var history = new ChangeHistory(obj);