Brian Vaughn
7 years ago
committed by
GitHub
4 changed files with 48 additions and 6 deletions
@ -0,0 +1,22 @@ |
|||||
|
/** |
||||
|
* 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