madebymany/eventable — pull request #6 by mcordingley (2014-10-16 01:30:53+00:00)
Title: Break Underscore.js Dependency

The only reason why I can see to use this library instead of Backbone is to keep from having to pull in lots of extra code. The trouble is, this still depends on Underscore. Underscore is a great library, but it still has some weight to it. From their respective sites, Underscore.js is 5.2kb minified and gzipped while Backbone is 6.5kb minified and gzipped. As it is, this library saves the majority of the cost of Backbone, but still incurs the full cost of Underscore, just to have access to a handful of functions from there.

I have taken the relevant Underscore functions and inlined them into Eventable. These functions are minimally modified and the modifications are documented in comments. This should prevent about 5kb of extra code from being needed.