Last active
March 25, 2017 22:37
-
-
Save aaronshaf/a512b3f2e9364cd5893fa41ba675fe37 to your computer and use it in GitHub Desktop.
How I minimize the flash of non-upgraded children of a custom element
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 class TimeagoElement extends HTMLElement { | |
connectedCallback() { | |
if (this.querySelector('time')) { | |
this.init() | |
} else { | |
window.requestAnimationFrame(() => { | |
this.init() | |
}) | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment