Last active
September 12, 2017 09:02
-
-
Save rts-rob/05bbd747c3c767a64194497b2d2d1262 to your computer and use it in GitHub Desktop.
Basic Promise-wrapped helper function framework
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
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