Skip to content

Instantly share code, notes, and snippets.

@jlongster
Last active October 15, 2015 20:49
Show Gist options
  • Save jlongster/d872962837e2d945fd6f to your computer and use it in GitHub Desktop.
Save jlongster/d872962837e2d945fd6f to your computer and use it in GitHub Desktop.
function taskMiddleware({ dispatch, getState }) {
return next => action => {
if(isGenerator(action)) {
// Not sure how to pass args via Task.spawn, can you do
// something like this?
return Task.spawn(action, dispatch, getState);
}
return next(action);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment