Created
April 27, 2019 13:42
-
-
Save deepal/c7b29bd3d1bf4456dca4225d9ec1f95e to your computer and use it in GitHub Desktop.
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 myAsyncFunction(callback) { | |
setTimeout(() => { | |
callback(new Error('oops')) | |
}, 1000); | |
} | |
myAsyncFunction((err) => { | |
if (err) { | |
// handle error | |
} else { | |
// happy path | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment