-
-
Save fearphage/1324007 to your computer and use it in GitHub Desktop.
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
This file contains 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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($, a, i) { | |
var o = $({}); | |
while (i) { | |
$[a[--i]] = (function(f) { | |
return function() { | |
f.apply(o, arguments); | |
}; | |
})(o[a[--i]]); | |
} | |
}(jQuery, 'on6subscribe6off6unsubscribe6trigger6publish'.split(6), 6)); |
This file contains 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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function(a,b,c){var d=a({});while(c)a[b[--c]]=function(a){return function(){a.apply(d,arguments)}}(d[b[--c]])})(jQuery,"on6subscribe6off6unsubscribe6trigger6publish".split(6),6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now smaller and illegible but theoretically faster.