(components, callback)
| 76 | |
| 77 | // Load components from urls |
| 78 | static load(components, callback) { |
| 79 | |
| 80 | // Necessary for dependency mapping |
| 81 | window.React = React |
| 82 | window.ReactNative = ReactNative |
| 83 | window.ReactDOM = ReactDOM |
| 84 | |
| 85 | // Format is an array of 2-element arrays [[ require-name, url ]] |
| 86 | const modules = components.filter(vc => vc.length === 2) |
| 87 | |
| 88 | // Format is an array of 3-element arrays [[ require-name, window-name, url ]] |
| 89 | const externals = components.filter(vc => vc.length === 3) |
| 90 | |
| 91 | Promise.all([ |
| 92 | this.loadModules(modules), |
| 93 | this.loadExternals(externals), |
| 94 | ]).then(callback) |
| 95 | } |
| 96 | } |
no test coverage detected