Javascript: jQuery PubSub

Don Graham
2012-09-29T21:57:11Z

gistfile1

| (function($) {
| var o = $( {} );
|
| $.each({
| on: 'subscribe',
| trigger: 'publish',
| off: 'unsubscribe'
| }, function( key, api ) {
| $[api] = function() {
| o[key].apply( o, arguments );
| }
| });
| })(JQuery);