Skip to content

Instantly share code, notes, and snippets.

@sjmiles
Created December 19, 2013 02:29
Show Gist options
  • Save sjmiles/8033424 to your computer and use it in GitHub Desktop.
Save sjmiles/8033424 to your computer and use it in GitHub Desktop.
explodeObservers: function(prototype) {
// called before prototype.observe is chained to inherited object
var o = prototype.observe;
if (o) {
var exploded = {};
for (var n in o) {
var names = n.split(' ');
for (var i=0, ni; ni=names[i]; i++) {
exploded[ni] = o[n];
}
}
prototype.observe = exploded;
//console.log(o, exploded);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment