News for hackers. Stuff that matters.
Re:Two.js by vec on Tuesday May 07, 2013 @12:35PM (#5669053)
That's not a big surprise. jQuery's events use native browser events behind the scenes. Which is nice for dom-oriented plugins; you get bubbling for free and all the native event listeners just work. It's got a pretty fair amount of overhead though. Backbone's events are just a pure JS event emitter implementation.

I'm curious, though, why they added an external dependency instead of just inlining a solution. There's a couple of good MIT licenced barebones implementations[1][2] floating around, and it's pretty straightforward to reimplement yourself in an hour or two if you prefer.

[1] https://github.com/Wolfy87/EventEmitter [2] https://github.com/hij1nx/EventEmitter2

Re:Two.js by jonobr1 on Tuesday May 07, 2013 @12:44PM (#5669103)
I was not aware of these other event systems in JavaScript. Thanks for pointing these out!
Re:Two.js by bfm on Wednesday May 08, 2013 @06:25AM (#5673410)
You also have Backbone events extracted from Backbone on https://github.com/bermi/eventify
Re:Two.js by imjared on Tuesday May 07, 2013 @01:26PM (#5669413)
Just to add to the list: https://github.com/necolas/emitter.js

:)

Re:Two.js by ajacksified on Tuesday May 07, 2013 @01:37PM (#5669480)
Re:Two.js by ianstormtaylor on Tuesday May 07, 2013 @02:55PM (#5669995)
or https://github.com/component/emitter if you wanted to get real modular and release the library as smaller Components.