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 class CancellableRetry { | |
| private _activePromiseRejectFunction: Function; | |
| private _functionToInvoke: Function; | |
| private _isCancelled = false; | |
| private _timerId: number; | |
| private _retryInMs: number; | |
| private _shouldRetry: (thrownError: Error) => boolean; | |
| constructor({ functionToInvoke, shouldRetry, retryInMs }) { | |
| this._functionToInvoke = functionToInvoke; |
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
| const helloWorldTemplate = document.createElement('template'); | |
| helloWorldTemplate.innerHTML = `<h1>Hello World!</h1>`; | |
| document.appendChild(helloWorldTemplate); | |
| class HelloWorld extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| const templateCopy = document.importNode(helloWorldTemplate, true); | |
| this.shadowRoot.appendChild(templateCopy); |
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
| class HelloWorld extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| } | |
| } |
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
| <hello-world></hello-world> |
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
| window.customElements.define('hello-word', HelloWorld) |
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
| class HelloWorld extends HTMLElement {} |