Skip to content

Instantly share code, notes, and snippets.

@alivedise
Created August 18, 2012 03:54
Show Gist options
  • Select an option

  • Save alivedise/3384248 to your computer and use it in GitHub Desktop.

Select an option

Save alivedise/3384248 to your computer and use it in GitHub Desktop.
$.Controller("Listener", {
"something.updated subscribe" : function(called, data){
console.log(data.name);
}
});
// called elsewhere
$.Controller("publisher", {
init: function(){
var data = { name: 'lol' };
this.publish("something.updated", data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment