An open API service indexing awesome lists of open source software.

https://github.com/gabrielmodog/usetimemachine

⏲️ Go forward and backwards with your state.
https://github.com/gabrielmodog/usetimemachine

Last synced: 9 months ago
JSON representation

⏲️ Go forward and backwards with your state.

Awesome Lists containing this project

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

```jsx
import { useTimeMachine } from "use-time-machine"

function App(){
const {history, sendTo, hasPast, hasFuture} = useTimeMachine([...]);

return

...

}
```

```jsx
import { useHistoryMachine } from 'use-time-machine';

function App() {
const { state, setCurrentState, goFoward, goBackward, resetState } =
useHistoryMachine('test');

return

...
;
}
```

by [@GabrielModog](https://twitter.com/gabrielmodog) - say hi!