use-time-machine
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

⏲️ 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!

Package Sidebar

Install

npm i use-time-machine

Weekly Downloads

6

Version

0.1.4

License

MIT

Unpacked Size

16.3 kB

Total Files

19

Last publish

Collaborators

  • modog