Skip to content

Instantly share code, notes, and snippets.

@rts-rob
Last active September 12, 2017 09:02
Show Gist options
  • Save rts-rob/05bbd747c3c767a64194497b2d2d1262 to your computer and use it in GitHub Desktop.
Save rts-rob/05bbd747c3c767a64194497b2d2d1262 to your computer and use it in GitHub Desktop.
Basic Promise-wrapped helper function framework
function promisePrototype(event) {
return new Promise(function(resolve, reject) {
if (success) {
resolve(someNewObject);
} else {
reject(buildError(500, "An internal error occured."));
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment