News for hackers. Stuff that matters.
Re:Backbone 0.9.0 released by oomkiller on Tuesday January 31, 2012 @01:16AM (#3532091)
This is probably a little bit late for this release, but have you ever considered allowing arrays or strings with spaces on the value side of the events hash? This would allow you to define different functions to call in order when an event is fired, instead of just a single function that has to call them itself. I've run into a few situations where this would be useful, and seems like a very small change. Should I send a pull request?
Re:Backbone 0.9.0 released by jashkenas on Tuesday January 31, 2012 @10:24AM (#3533585)
Ha ha. That's actually already in 0.9.0, and I managed to miss it when reading through the commit list for the change log.

I've added the corresponding documentation, and added it to the change log for 0.9 as well.

http://backbonejs.org/#Events-on

Re:Backbone 0.9.0 released by DougWebb on Tuesday January 31, 2012 @09:08AM (#3533241)
I'm not familiar with the Backbone code or config. However, it sounds like you are setting an argument by specifying a function name in a string. If you want to specify multiple functions, then instead of specifying them in a string I'd say Backbone should accept either a string or a function as the argument value. That would let you define your event handler in-place, and you could define one that just calls a series of other functions.
Re:Backbone 0.9.0 released by jashkenas on Tuesday January 31, 2012 @10:28AM (#3533610)
No, that's not quite it. It's simply that you're now allowed to bind and trigger multiple event names in a single call, as in jQuery. For example:

    book.on("change:title change:author", function() {
      ...
    });