MCPcopy
hub / github.com/nbubna/store / on

Function on

libs/requirejs.js:498–515  ·  view source on GitHub ↗
(depMap, name, fn)

Source from the content-addressed store, hash-verified

496 }
497
498 function on(depMap, name, fn) {
499 var id = depMap.id,
500 mod = getOwn(registry, id);
501
502 if (hasProp(defined, id) &&
503 (!mod || mod.defineEmitComplete)) {
504 if (name === 'defined') {
505 fn(defined[id]);
506 }
507 } else {
508 mod = getModule(depMap);
509 if (mod.error && name === 'error') {
510 fn(mod.error);
511 } else {
512 mod.on(name, fn);
513 }
514 }
515 }
516
517 function onError(err, errback) {
518 var ids = err.requireModules,

Callers 1

newContextFunction · 0.85

Calls 4

getOwnFunction · 0.85
hasPropFunction · 0.85
fnFunction · 0.85
getModuleFunction · 0.85

Tested by

no test coverage detected