UNPKG

@alugha/ima

Version:

A library for asynchronously loading the Google IMA SDK with static typing for the SDK

13 lines (12 loc) 415 B
"use strict"; // Asynchronous loader for external scripts Object.defineProperty(exports, "__esModule", { value: true }); const loadScript = (src) => new Promise((resolve, reject) => { const script = document.createElement("script"); script.async = true; script.src = src; script.onload = resolve; script.onerror = reject; document.body.appendChild(script); }); exports.default = loadScript;