renanpvaz
7 years ago
5 changed files with 43 additions and 20 deletions
@ -0,0 +1,21 @@ |
|||
/** |
|||
* Copyright (c) 2013-present, Facebook, Inc. |
|||
* |
|||
* This source code is licensed under the MIT license found in the |
|||
* LICENSE file in the root directory of this source tree. |
|||
* |
|||
* @emails react-core |
|||
*/ |
|||
|
|||
'use strict'; |
|||
|
|||
export default url => new Promise((resolve, reject) => |
|||
document.head.appendChild( |
|||
Object.assign(document.createElement('script'), { |
|||
async: true, |
|||
src: url, |
|||
onload: resolve, |
|||
onerror: reject |
|||
}) |
|||
) |
|||
); |
Loading…
Reference in new issue