steveosoule
5/26/2016 - 10:06 PM

jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.

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/
 * https://github.com/cowboy/jquery-tiny-pubsub
 * 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));