undoredostring
v1.0.2
Published
A simple string undo/redo library for JavaScript
Downloads
3
Maintainers
Readme
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 [email protected]. LinkedIn: https://www.linkedin.com/in/imrankhan001/
P.S: I excel in Remote Work Only