Skip to content

Instantly share code, notes, and snippets.

@jhuttner
Created September 29, 2011 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhuttner/1251710 to your computer and use it in GitHub Desktop.
Save jhuttner/1251710 to your computer and use it in GitHub Desktop.
My Code Review Submission
_oMyController.setListener('firstEvent secondEvent', function(data) {
if (data.is_second_event) {
// do something specific just to the second event
}
// do something common to both events
});
//////// VERSUS //////////////
_oMyController.setListener('firstEvent secondEvent', function(data, event_name) {
if (event_name === 'secondEvent') {
// do something specific just to the second event
}
// do something common to both events
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment