Created
September 25, 2019 10:03
-
-
Save vertcitron/aa8af675911b9bb02902a38c4601ac17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default abstract class Component { | |
abstract element: HTMLElement | |
public render (parent: HTMLElement | Component): void { | |
if (parent instanceof Component) { | |
parent.element.appendChild(this.element) | |
} else { | |
parent.appendChild(this.element) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment