-
-
Save Marak/1431484 to your computer and use it in GitHub Desktop.
How should I be doing the callback?
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
user.save().on('success', handler).on('failure', handler) | |
function handler (result) { | |
if(result.err) { // or something like this | |
return callback(err); | |
} | |
return callback(null, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment