Skip to content

Instantly share code, notes, and snippets.

@ranyefet
Created June 27, 2013 11:27
Show Gist options
  • Save ranyefet/5875744 to your computer and use it in GitHub Desktop.
Save ranyefet/5875744 to your computer and use it in GitHub Desktop.
Using $.triggerQueueCallback
var $obj = $({});
$obj.bind('myEvent', function( param, callback ) {
// do stuff
callback();
});
$obj.bind('myEvent', function( param, callback ) {
// do stuff
callback();
});
var data = {
foo: "bar"
};
$obj.triggerQueueCallback( 'myEvent', data, function() {
console.log( 'This message will be shown once!' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment