Skip to content

Instantly share code, notes, and snippets.

Forked from cowboy/
Last active August 29, 2015 14:02
What would you like to do? = (function($) {
var broker = $({});
return {
subscribe: function() {
$.fn.on.apply(broker, arguments);
unsubscribe: function() {
$, arguments);
publish: function() {
$.fn.trigger.apply(broker, arguments);
Copy link

Use it like $.news.publish, $.news.subscribe, $.news.unsubscribe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment