Skip to content

Instantly share code, notes, and snippets.

@sethmcl
Created January 27, 2014 01:51
Show Gist options
  • Select an option

  • Save sethmcl/8642132 to your computer and use it in GitHub Desktop.

Select an option

Save sethmcl/8642132 to your computer and use it in GitHub Desktop.
// ViewA.js
initialize: function () {
this.whisper.capture('item-selected');
}
// ViewF.js
initialize: function () {
this.whisper.on('item-selected', this.onItemSelected, this);
}
// ViewF.js
onItemSelected: function (eventName, data, reply) {
var message = 'Item <strong>' + data.itemId + '</strong> selected';
this.$el.find('.event').html(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment