0.0.4 • Published 5 years ago

@fa-repo/undo-redo v0.0.4

Weekly downloads
-
License
mit
Repository
github
Last release
5 years ago

@fa-repo/undo-redo

A javascript package for handling basic undo/redo functionality

NPM

Install

npm install --save @fa-repo/undo-redo

Basic usage

import UndoRedo from '@fa-repo/undo-redo';
import arrayMove from 'array-move';

let items = ['apple', 'pear', 'mango'];

const undoRedo = new UndoRedo();

const moveItem = (from, to) => {
  undoRedo.add({
    do: () => arrayMove(items, from, to),
    undo:() => arrayMove(items, to, from),
  })
}

const undoChanges = () => {
  undoRedo.undo();
}

const redoChanges = () => {
  undoRedo.redo();
}

Docs / examples

Discover api and use cases here.

License

mit © @fa-repo

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago