@xpf0000/js-data-history
v1.0.0
Published
Js data history, data change revoke and redo, can set history depth
Readme
Js data history, data change revoke and redo, can set history depth
Table of Contents
Install and basic usage
$ npm install --save @xpf0000/js-data-historyimport { History } from '@xpf0000/js-data-history'
const history = new History(5)
const data = {}
history.init(data)
data.a = {}
history.add()
data.b = 5
history.add()
history.back()
history.back().then(change => {
// ...
})
history.redo()
history.redo().then(change => {
// ...
})License
The MIT License (MIT).
