Skip to content

Instantly share code, notes, and snippets.

@tanabe
Created February 24, 2012 10:10
Show Gist options
  • Save tanabe/1899926 to your computer and use it in GitHub Desktop.
Save tanabe/1899926 to your computer and use it in GitHub Desktop.
buggy component
//1 to 4
Component.prototype.initialize = function(element) {
//not good
//4. this handler is still alive.
model.method("create").observe(this.handler);
};
Component.prototype.handler = function() {
//not good
//3. manipulate element but, element is not exists on DOM tree.
};
//1. create component
registerElement: function(element) {
//not good. useless instance
var component = new Component(element);
}
//2. remove component element from DOM tree.
componentElement.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment