Skip to content

Instantly share code, notes, and snippets.

@ashblue
Created July 30, 2012 16:41
Show Gist options
  • Save ashblue/3208278 to your computer and use it in GitHub Desktop.
Save ashblue/3208278 to your computer and use it in GitHub Desktop.
Append an existing JavaScript callback
/**
* Append an existing callback.
* @param {function} callback Callback to append.
* @param {function} append Data appended to the existing callback.
* @returns {function} Returns the newly assembled callback.
*/
function appendCallback(callback, append) {
var newCallback = function () {
callback();
append();
};
return newCallback;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment