This is my attempt at at implementing undo (no redo for now) in Redux.
Middleware is used to implement a command pattern approach to undo / redo, where incoming actions are identified as Commands and added to a stack.
When the undo()
action is raised the middleware halts the current action instead calling the undo method of the previous Command.
- Due to implementing via middleware, only one stack may exist for the entire application.