4 ms·
«The Backbone object now extends Events so that you can use it as a global event bus, if you like.» This is great, up until now I've extended the app with Back
by lordlarm 14y ago
«The Backbone object now extends Events so that you can use it as a global event bus, if you like.»
This is great, up until now I've extended the app with Backbone.Event like:
App = {
view = {},
model = {},
collection = {},
events = {},
_.extend(App.events, Backbone.events)
Congrats on the soon-to-be 1.0 release :)
- Cthulhu_ 14y agoSame, although we use it in combination with Require, so we had an 'events' module: define(["Backbone", "underscore"], function(Backbone, _) { return _.extend({}, Backbone.Events); }); and a dependency on 'events' in all our modules: define(["Backbone", "events"), function(Backbone, Events) { // stuff Events.on("event", stuff); });