@xpf0000/js-data-history
v1.0.0
Published
Js data history, data change revoke and redo, can set history depth
Downloads
2
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-history
import { 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).