Created
April 18, 2018 15:12
-
-
Save joeRinehart/05842c86b2df781c12c9fe5a18012a34 to your computer and use it in GitHub Desktop.
Why the heck is it always catching?!?! Oh...derp.
This file contains hidden or 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
class Thing { | |
doStuffWithFile( file ) { | |
return new Promise( ( reject, resolve ) => { | |
/* | |
do shit... | |
*/ | |
resolve(stuff) | |
}) | |
} | |
} | |
var thing = new Thing() | |
thing.doStuffWithFile('someFile') | |
.then( () => { | |
console.log("good!") } | |
) | |
.catch( (error) => { | |
console.log("error", error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment