1.0.0 • Published 3 years ago

@xpf0000/js-data-history v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Latest Version on NPM Software License npm

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).