use-time-machine
v0.1.4
Published
A simple undo/redo state hook
Downloads
22
Maintainers
Readme
⏲️ useTimeMachine
A simple React.js hook to go forward and backwards with your state.
Install now
yarn add use-time-machine
or
npm i use-time-machine
Samples
import { useTimeMachine } from "use-time-machine"
function App(){
const {history, sendTo, hasPast, hasFuture} = useTimeMachine([...]);
return <div>...</div>
}
import { useHistoryMachine } from 'use-time-machine';
function App() {
const { state, setCurrentState, goFoward, goBackward, resetState } =
useHistoryMachine('test');
return <div>...</div>;
}
by @GabrielModog - say hi!