Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save sethmcl/8642143 to your computer and use it in GitHub Desktop.
// 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);
reply.resolve('View F says hello!');
}
// ViewE.js
this.whisper('item-selected', { itemId: id }).then(function (replyMessage) {
alert(replyMessage);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment