The Git tag for this section is undo-redo. If you haven't already, please move to that tag now.
In this section, we'll add undo and redo buttons at the top of the page, which allow the user to undo statements that they've previously run. They'll work like this:
- Initially, both buttons will be disabled.
- Once the user executes a statement, the Undo button will become enabled.
- When the user clicks the Undo button, the last statement will be undone.
- At that point, the Redo button becomes available and the user can choose to redo the last statement.
- Multiple actions can be undone and then redone, in sequence.
- If the user performs a new action while Redo is available, the redo sequence is cleared and the Redo button becomes unavailable again.
Aside from the buttons, the work involved here is building a new reducer, withUndoRedo...