hasokeric
5/31/2013 - 3:37 AM

jQuery PubSub in three lines. This will work in IE9+, so it's a perfect choice for jQuery 2.0 projects.

jQuery PubSub in three lines. This will work in IE9+, so it's a perfect choice for jQuery 2.0 projects.

var o = $({});
$.subscribe = o.on.bind(o);
$.publish = o.trigger.bind(o);