on off trigger

/* jQuery XXS Pub/Sub
 * @tdecs
 * Dual licensed under the MIT and GPL licenses */
 
(function ($, o) {
 
  o = $({});
 
  $.subscribe = function(e, h) {
    o.on.call(o, e, h);
  };
 
  $.unsubscribe = function(e, h) {
    o.off.call(o, e, h);
  };
 
  $.publish = function(e, h) {
    o.trigger.call(o, e, h);
  };
 
}(jQuery));

  

var pubsub = _.extend({}, Backbone.Event);

  

原文地址:https://www.cnblogs.com/leamiko/p/2976426.html