Skip to content

v0.6.0

Compare
Choose a tag to compare
@jamesplease jamesplease released this 02 Aug 14:34
· 110 commits to master since this release

Note: This release includes a breaking API change.

The breaking change is the removal of the connectX methods, such as connectEvents. These were methods that were used to connect multiple handlers at once. As of this release, you can simply pass an object into the regular registration methods. For instance,

// Registers two handlers at once
myChannel.comply({
  'get:food': getFood,
  'eat:food': eatFood
}, myContext);

There are also two new features with this release.

  • channelName is now a public property on a channel.
  • Channels can now have default handlers. This can be used to handle all unregistered events within your application.
var channel = Backbone.Radio.channel('test');

// Set our default handler
channel.reply('default', function() {
  console.log("Sorry, this request isn't registered.");
});

// Make an unregistered request and it logs to the console.
channel.request('null');