1.0.0 • Published 3 years ago
@xpf0000/js-data-history v1.0.0
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).
1.0.0
3 years ago