Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "olcs/contrib/LazyLoader"

Index

Variables

Variables

Const exports

exports: exports = class {/*** @param {string} url* @struct* @api*/constructor(url) {/*** @type {Promise<undefined>}* @protected*/this.promise;/*** @private* @type {string}*/this.url_ = url;}/*** @return {Promise<undefined>}* @api*/load() {if (!this.promise) {// not yet loadingthis.promise = new Promise((resolve, reject) => {const script = document.createElement('script');script.onload = () => resolve();script.onerror = () => reject();document.head.appendChild(script);script.src = this.url_;});}return this.promise;}}
module

olcs.contrib.LazyLoader

Generated using TypeDoc