Created
December 6, 2012 13:20
-
-
Save biabsnippets/4224404 to your computer and use it in GitHub Desktop.
Revisions
-
biabsnippets revised this gist
Dec 6, 2012 . 1 changed file with 15 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,17 @@ /* * Sexy Pub/Sub (jQuery Edition) * * Hat tip Paul Irish & Jeffrey Way. */ (function($) { var o = $({}); $.each({ on: 'subscribe', trigger: 'publish', off: 'unsubscribe' }, function(key, api) { $[api] = function() { o[key].apply(o, arguments); } }); })(jQuery); -
biabsnippets created this gist
Dec 6, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ (function($) { var o = $({}); $.each({ on: 'subscribe', trigger: 'publish', off: 'unsubscribe' }, function(key, api) { $[api] = function() { o[key].apply(o, arguments); } }); })(jQuery);