Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created May 31, 2013 03:37
Show Gist options
  • Save JeffreyWay/5682808 to your computer and use it in GitHub Desktop.
Save JeffreyWay/5682808 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment