Skip to content

Instantly share code, notes, and snippets.

@vojtatranta
Created May 3, 2016 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vojtatranta/d5b9759f226e96b25bbf97341bd2e74c to your computer and use it in GitHub Desktop.
Save vojtatranta/d5b9759f226e96b25bbf97341bd2e74c to your computer and use it in GitHub Desktop.
Unhell promise
// unhell promise
ImageProcessor.prototype.execResizeImage = function ImageProcessor_execResizeImage(option, imageData) {
var resizer = new ImageResizer(option.size);
return resizer.exec(imageData)
.then(function(resizedImage) {
var reducer = new ImageReducer(option);
return reducer.exec(resizedImage)
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment