Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Last active March 25, 2017 22:37
Show Gist options
  • Save aaronshaf/a512b3f2e9364cd5893fa41ba675fe37 to your computer and use it in GitHub Desktop.
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
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