Created
November 7, 2019 19:23
-
-
Save jcdalton2201/21d467bcb7b8785b0af2aa22dc0b7882 to your computer and use it in GitHub Desktop.
dynamic import
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 ExternalFiles{ | |
constructor() { | |
this.getChat(); | |
this.getCalendar(); | |
} | |
async getChat(){ | |
if(!customElements.get('foo-chat')){ | |
await import('chat/chat.js'); | |
} | |
} | |
async getCalendar(){ | |
if(!customElements.get('foo-calendar')){ | |
await import('calendar/calendar.js'); | |
} | |
} | |
} | |
new ExternalFiles(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment