Created
October 31, 2018 11:07
-
-
Save ufocoder/08c7b289d0e0c856bb3ab6f57c6c19c0 to your computer and use it in GitHub Desktop.
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
| function higherOrderNodeCallback (onSuccess, onError) { | |
| function nodeCallback (err, thingIWant) { | |
| if (err) { | |
| onError(err); | |
| } else { | |
| onSuccess(thingIWant); | |
| } | |
| } | |
| return nodeCallback; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment