Skip to content

Instantly share code, notes, and snippets.

@cowboy
Last active February 27, 2025 12:24
Show Gist options
  • Save cowboy/661855 to your computer and use it in GitHub Desktop.
Save cowboy/661855 to your computer and use it in GitHub Desktop.
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
};
$.unsubscribe = function() {
o.off.apply(o, arguments);
};
$.publish = function() {
o.trigger.apply(o, arguments);
};
}(jQuery));
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function(a){var b=a({});a.subscribe=function(){b.on.apply(b,arguments)},a.unsubscribe=function(){b.off.apply(b,arguments)},a.publish=function(){b.trigger.apply(b,arguments)}})(jQuery)
@cowboy
Copy link
Author

cowboy commented Feb 10, 2025

Man why do I even bother with open source

@alyxjame
Copy link

At Zap It Pest Control, we provide top-quality solutions to keep homes and businesses free from unwanted pests. Our experienced team offers safe and effective treatments for cockroaches, rodents, termites, mosquitoes, and more. Using eco-friendly methods, we ensure long-term pest prevention. Customer satisfaction and a pest-free environment are our top priorities. Trust Pest Control Melbourne for reliable, professional, and affordable pest control services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment