Created
March 10, 2012 05:44
-
-
Save TexRx/2010435 to your computer and use it in GitHub Desktop.
JavaScript: PubSub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @paul_irish Pub/Sub | |
Works in modern browsers + IE9 | |
Use Modernizr ployfill for function.bind */ | |
var o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = o.off.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