Skip to content

v0.8.0

Compare
Choose a tag to compare
@jamesplease jamesplease released this 26 Oct 01:36
· 87 commits to master since this release

View change summary

DEBUG warnings when overwriting callbacks

When you overwrite a Request or Command in debug mode you will now get a warning.

// Turn on debug mode
Backbone.Radio.DEBUG = true;

// Register a reply
Backbone.Radio.reply('myChannel', 'someReply', 2);

// Overriding it will send a warning to the console!
Backbone.Radio.reply('myChannel', 'someReply', 5);

stopReplying and stopComplying now support the second and third arguments

The big change here is that the removal methods are more powerful, as they now support the same arguments as off. This gives you finer-grained control over the things that you unregister. You can, for instance, unregister by callback, or by context.

// Remove all callbacks with the context of 'this'
myChannel.stopComplying(undefined, undefined, this);