Created
October 2, 2018 15:17
-
-
Save nem035/f58339cd1706559e07ba397260a22157 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
httpGet(url, once(processValue)); | |
function once(cb) { | |
var hasExecuted = false; | |
return function callbackWrapper() { | |
if (!hasExecuted) { | |
hasExecuted = true; | |
cb.apply(this, arguments); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment