undoredostring
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

About

This is a simple library to implement string undo/redo functionality in your project.

Usage

import undoRedo from "undoredostring";

const [str, setStr] = useState("Hello World");

const undoRedoStr = undoRedo(str);

const onClickUndoStr = () => {
  setStr(undoRedoStr.undo());
};

const onClickRedoStr = () => {
  setStr(undoRedoStr.redo());
};
<input type="text" id="input" value={str} onChange={(e) => setStr(e.target.value)} />

<button id="undo" onClick={onClickUndoStr}>Undo</button>
<button id="redo" onClick={onClickRedoStr}>Redo</button>

Hire Me

Want to hire a kickass senior frontend dev?

Email me at ikhan77727@gmail.com. LinkedIn: https://www.linkedin.com/in/imrankhan001/

P.S: I excel in Remote Work Only

Package Sidebar

Install

npm i undoredostring

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

13.8 kB

Total Files

4

Last publish

Collaborators

  • imran001