conbo-changehistory
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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 history
  • forward() moved forward 1 step in hisyory
  • go(n) moves n steps backwards or forwards in history
  • currentIndex is the current place in history
  • beforeFirst indicates whether you are at a point in history before any changes were made
  • atLast indicates that you are at the end of history

Getting started

Initialising ChangeHistory for an object couldn't be easier:

var history = new ChangeHistory(obj);

Package Sidebar

Install

npm i conbo-changehistory

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mesmotronic