I have a outlining app that I am writing using unidirectional dataflow and some of the concepts from Redux.
When the user has selects items in the outline, and clicks indent, an indent action is fired. This needs to update the state of the app via some complex rules that modify the parent
property of some, if not all, of the items being indented.
These changes also need to persist out to a web service.
I do not want to repeat this logic in multiple places.
The question is, should I be applying this logic inside of the middleware, and just passing along simpler actions to the reducer? Or should I be somehow analyzing the state after the reducer has applied the logic and then sending the changes to the web service?