In the file 10_middleware.js there is an example of a function that returns functions, but only the last one executes anything. When I saw it immediately recognized it as an opportunity to apply more functional patterns. Specifically it looks like a primitive curry.
I have not yet finished the tutorial or used Redux. So if there a reason later revealed or not covered in the tutorial please let me know.
In the file 10_middleware.js there is an example of a function that returns functions, but only the last one executes anything. When I saw it immediately recognized it as an opportunity to apply more functional patterns. Specifically it looks like a primitive curry.
I have not yet finished the tutorial or used Redux. So if there a reason later revealed or not covered in the tutorial please let me know.
The original code:
Suggested code with curry:
I tested it and it worked just fine in the context of the tutorial.