You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| set |`function`| Assign a new value to `present`. |
96
+
| reset |`function`| Clear `past` array and `future` array. Assign a new value to `present`. |
97
+
| undo |`function`| See [handling-undo](https://redux.js.org/recipes/implementing-undo-history#handling-undo). |
98
+
| redo |`function`| See [handling-redo](https://redux.js.org/recipes/implementing-undo-history#handling-redo). |
99
+
| canUndo |`boolean`| Check whether `state.undo.length` is `0`. |
100
+
| canRedo |`boolean`| Check whether `state.redo.length` is `0`. |
101
101
102
102
## How does it work?
103
103
104
-
Refer to [_Redux Implementing Undo History_](https://redux.js.org/recipes/implementingundohistory), `use-undo` implements the same concect with [`useReducer`](https://reactjs.org/docs/hooks-reference.html#usereducer).
104
+
Refer to [_Redux Implementing Undo History_](hhttps://redux.js.org/recipes/implementing-undo-history), `use-undo` implements the same concect with [`useReducer`](https://reactjs.org/docs/hooks-reference.html#usereducer).
105
105
The state structure looks like:
106
106
107
107
```js
@@ -120,4 +120,4 @@ It stores all states we need. To operate on this state, there are three function
0 commit comments