August 2017
Beginner
374 pages
10h 41m
English
Although the undo/redo feature we implemented in the previous section works well, it only works with the counter state. If we had a different use case, such as undo/redo in a text field, we would have to re-implement the whole undo/redo logic.
Furthermore, our counter reducer is now dealing with much more than just counting--it is also dealing with undo/redo behavior. This is an indicator for refactoring potential--in this case, we can refactor the undo/redo behavior into a generic undo/redo higher-order reducer.
Read now
Unlock full access