MCPcopy
hub / github.com/apache/echarts / invokeFactory

Function invokeFactory

test/lib/simpleRequire.js:138–152  ·  view source on GitHub ↗
(factory, depsPromise)

Source from the content-addressed store, hash-verified

136 }
137
138 function invokeFactory(factory, depsPromise) {
139 if (typeof factory === 'function') {
140 return depsPromise.then(function (deps) {
141 var modExports = {};
142 var factoryRet = factory.apply(null, deps.map(function (dep) {
143 return dep === exportsPlaceholder ? modExports : dep;
144 }));
145 return factoryRet || modExports;
146 });
147 }
148 else {
149 // define(JSONObject)
150 return factory;
151 }
152 }
153
154 // Simplify the logic. don't support id.
155 function define(modId, depsIds, factory) {

Callers 2

defineFunction · 0.85
loadedFunction · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…