history-state-manager
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

history-state-manager

Efficient management of state history with structure sharing, providing a non-intrusive approach to tracking state changes in web and software applications.This solution aims to minimize data duplication by sharing common parts between successive state thereby improving performance and reducing memory consumption

Installation

Install via NPM :

    npm i history-state-manager

Basic usage:

import { History } from 'history-state-manager'

const state = { a: 1, b: 2 }

const history = new History()
history.pushSync(state) // the terser `history.push` API is async

state.a = 2 // mutation!
history.pushSync(state)

history.get() // { a: 2, b: 2 }
history.undo().get() // { a: 1, b: 2 }
history.redo().get() // { a: 2, b: 2 }

/history-state-manager/

    Package Sidebar

    Install

    npm i history-state-manager

    Weekly Downloads

    5

    Version

    0.0.4

    License

    ISC

    Unpacked Size

    53.6 kB

    Total Files

    8

    Last publish

    Collaborators

    • ramses237