(
);
const App = () => {
- const { prevStates, undo } = useUndo();
- const { bears, increasePopulation, removeAllBears } = useStore();
+ const { prevStates, undo, futureStates, redo } = useUndo();
+ const store = useStore();
+ const { bears, increasePopulation, removeAllBears } = store;
return (
🐻 ♻️ Zundo!
previous states: {JSON.stringify(prevStates)}
+ future states: {JSON.stringify(futureStates)}
+
+ current state: {JSON.stringify(store)}
+
bears: {bears}
@@ -50,6 +55,7 @@ const App = () => {
+
);
};