UNPKG

@alugha/ima

Version:

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

11 lines (10 loc) 335 B
// Asynchronous loader for external scripts 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); }); export default loadScript;