Skip to content

Instantly share code, notes, and snippets.

@robertcasanova
Created August 27, 2013 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertcasanova/6354026 to your computer and use it in GitHub Desktop.
Save robertcasanova/6354026 to your computer and use it in GitHub Desktop.
Observer Pattern With Backbone: communication between objects.
var observer = {};
_.extend(observer,Backbone.Events);
//use
observer.trigger("keyboard:pressed",obj);
observer.on("keyboard:pressed", function(obj) {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment