Skip to content

Instantly share code, notes, and snippets.

@jasonmcleod
Last active December 19, 2015 03:49
Show Gist options
  • Select an option

  • Save jasonmcleod/5892912 to your computer and use it in GitHub Desktop.

Select an option

Save jasonmcleod/5892912 to your computer and use it in GitHub Desktop.
Circular JSON PFFFFFT
module.exports = function(self, options) {
this.bind = function(events) {
for(var e in events) {
(function(func) {
options.socket.on(func, function(data) { self[func](options, data) });
})(events[e])
}
}
}
@philspitler
Copy link

Hell yeah!!!

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