Skip to content

Instantly share code, notes, and snippets.

@jmwhittaker
Forked from plukevdh/crunchy_pubsub.js
Created May 9, 2012 17:28
Show Gist options
  • Save jmwhittaker/2646959 to your computer and use it in GitHub Desktop.
Save jmwhittaker/2646959 to your computer and use it in GitHub Desktop.
Faux pubsub. Could also use jQuery event binding if you rather.
crunch.pubsub = _.extend({}, Backbone.Events);
// Hide backbone implementation by aliasing
crunch.pubsub.publish = crunch.pubsub.trigger;
crunch.pubsub.subscribe = crunch.pubsub.bind;
crunch.pubsub.unsubscribe = crunch.pubsub.unbind;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment