Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var promise = new Promise(function(resolve, reject) {
- // do a thing, possibly async, then…
- if (/* everything turned out fine */) {
- resolve("Stuff worked!");
- }
- else {
- reject(Error("It broke"));
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment