MCPcopy Create free account
hub / github.com/dabbott/javascript-playgrounds / load

Method load

components/player/VendorComponents.js:78–95  ·  view source on GitHub ↗
(components, callback)

Source from the content-addressed store, hash-verified

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}

Callers 2

player-bundle.jsFile · 0.80
player.jsFile · 0.80

Calls 2

loadModulesMethod · 0.95
loadExternalsMethod · 0.95

Tested by

no test coverage detected