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 acb8a29 commit 60e1ac4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ A React hook for state time travel with undo, redo, and reset functionalities.

`use-travel` is a small and high-performance library for state time travel. It's built on [Mutative](https://github.com/unadlib/mutative) to support mutation updating immutable data. It's designed to be simple and easy to use, and it's also customizable for different use cases.

It's suitable for building any time travel feature in your application.

### Installation

```bash
Expand Down Expand Up @@ -90,8 +92,8 @@ const App = () => {

| Return | type | description |
| --------------------- | -------------------------- | ---------------------------------------------------------------------- |
| `state` | T | The current state |
| `setState` | Dispatch<T> | The state setter, support mutation update or return immutable data |
| `state` | Value<S, F> | The current state |
| `setState` | Updater<InitialValue<S>> | The state setter, support mutation update or return immutable data |
| `controls.back` | () => void | Go back to the previous state |
| `controls.forward` | () => void | Go forward to the next state |
| `controls.reset` | () => void | Reset the state to the initial state |
Expand Down

0 comments on commit 60e1ac4

Please sign in to comment.