This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A redux middleware for processing Meteor methods | |
* When an action is dispatched, it will pass through our middleware. | |
* if denoted a method, we will dispatch the action with readyState of loading | |
* The method passed in is then called, and dispatches further ready states for success/error | |
* The reducer shape should include { data, readyState } for use in the UI | |
* @returns {Function} | |
*/ | |
export default function methodMiddleware() { | |
return (next) => { |