tiny-pubsub.js 565 Bytes
/*
 * jQuery Tiny Pub/Sub - v0.6 - 1/10/2011
 * http://benalman.com/
 *
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function ($) { var a = $({}); $.subscribe = function (b, c) { function d() { return c.apply(this, Array.prototype.slice.call(arguments, 1)); }d.guid = c.guid = c.guid || ($.guid ? $.guid++ : $.event.guid++); a.bind(b, d); }; $.unsubscribe = function () { a.unbind.apply(a, arguments); }; $.publish = function () { a.trigger.apply(a, arguments); }; }(jQuery));