Skip to content

Commit

Permalink
docs(readme): update
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Mar 23, 2024
1 parent 60e1ac4 commit 8ded001
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ yarn add use-travel mutative
- High performance
- Mark function for custom immutability

### Example

<iframe src="https://stackblitz.com/edit/react-xfw3uk?embed=1&file=src%2FApp.js"></iframe>

### API

You can use `useTravel` to create a time travel state. And it returns a tuple with the current state, the state setter, and the controls. The controls include `back`, `forward`, `reset`, `canBack`, `canForward`, `getHistory`, `patches`, `position`, `archive`, and `go`.
Expand Down

0 comments on commit 8ded001

Please sign in to comment.