1.0.2 • Published 1 year ago

undoredostring v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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