           @removeAttribute attrName
       @observedAttributes.push(attrName) if observed
 
+    @tag: '' # to be set by child class
+
+    @register: (componentClass) ->
+      return unless componentClass.tag
+      customElements.define componentClass.tag, componentClass
+
     @observedAttributes: []
 
     connectedCallback: ->


window.TaoComponentBasedOn = TaoComponentBasedOn
window.TaoComponent = TaoComponentBasedOn 'HTMLElement'
window.TaoComponent.register = (componentClass) ->
  return unless componentClass.tag
  customElements.define componentClass.tag, componentClass

  return components[superClass] if components[superClass]

  class components[superClass] extends window[superClass]

    @extend: (obj) ->
      unless obj and typeof obj == 'object'
