Skip to content

Instantly share code, notes, and snippets.

@ufocoder
Created October 31, 2018 10:52
Show Gist options
  • Select an option

  • Save ufocoder/83ed01863d9d2f30822900d8ed80f602 to your computer and use it in GitHub Desktop.

Select an option

Save ufocoder/83ed01863d9d2f30822900d8ed80f602 to your computer and use it in GitHub Desktop.
function handleError (err) { /* ... */ }
function handleSuccess (x) { /* ... */ }
function nodeCallback (err, thingIWant) {
if (err) {
handleError(err);
} else {
handleSuccess(thingIWant);
}
}
someNodeFunction(arg, nodeCallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment