1.0.1 • Published 2 years ago

status-record v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Describe

js 状态记录机

Installation

$ npm install status-record

API

import StatusRecord from 'status-record';
// 实例化
const statusRecord = new StatusRecord();
// 访问当前记录器的长度
const length = statusRecord.length;
// 访问当前记录器下标指向的状态
const state = statusRecord.state;
  • back() 返回上一条记录
  • forward() 前往下一条记录
  • go(step) 前往相对当前记录的之前/之后记录
  • pushState(state) 向当前记录索引之后插入一条新的记录
  • replaceState(state) 替换当前记录索引的状态

License

MIT