feat(loadScript): Use the function from js-utils

This commit is contained in:
hristoterezov 2018-03-22 13:15:14 -05:00
parent 15e1633d86
commit 9fa1b210f5
1 changed files with 3 additions and 3 deletions

View File

@ -1,17 +1,17 @@
// @flow
declare var JitsiMeetJS: Object;
import { loadScript as loadScriptF } from 'js-utils';
/**
* Loads a script from a specific URL. The script will be interpreted upon load.
*
* @param {string} url - The url to be loaded.
* @returns {Promise} Resolved with no arguments when the script is loaded and
* rejected with the error from JitsiMeetJS.ScriptUtil.loadScript method.
* rejected with the error from loadScriptF method.
*/
export function loadScript(url: string): Promise<void> {
return new Promise((resolve, reject) =>
JitsiMeetJS.util.ScriptUtil.loadScript(
loadScriptF(
url,
/* async */ true,
/* prepend */ false,