Created
May 28, 2017 22:31
-
-
Save tbranyen/57b64798a0ec02f178492f29b6cdba46 to your computer and use it in GitHub Desktop.
This file contains 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
// Allow the user to invoke the Custom Element chain. | |
function makeElement(tagName, props) { | |
const Constructor = customElements.get(tagName); | |
if (Constructor) { | |
return new Constructor(props); | |
} | |
else { | |
document.createElement(tagName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment