src/index.js
function runtimeReq(mId) {
  const parsed = parse(mId);
  return _fetch(parsed.cleanId)
  .then(response => {
    // ensure default user space
    define.switchToUserSpace();

    for (let i = 0, len = _translators.length; i < len; i++) {
      const result = _translators[i](parsed, response);
      if (result && typeof result.then === 'function') return result;
    }
    throw new Error(`no runtime translator to handle ${parsed.cleanId}`);
  })
  .then(() => {
    if (userSpace.has(parsed.cleanId)) return userSpace.req(parsed.cleanId);
    throw new Error(`module "${parsed.cleanId}" is missing from url "${toUrl(mId)}"`);
  })
  .catch(err => {
    console.error(`could not load module "${parsed.cleanId}" from remote`); // eslint-disable-line no-console
    throw err;
  });
}
function runtimeReq(mId) {
  const parsed = parse(mId);
  return _fetch(parsed.cleanId)
  .then(response => {
    // ensure default user space
    define.switchToUserSpace();

    for (let i = 0, len = _translators.length; i < len; i++) {
      const result = _translators[i](parsed, response);
      if (result && typeof result.then === 'function') return result;
    }
    throw new Error(`no runtime translator to handle ${parsed.cleanId}`);
  })
  .then(() => {
    if (userSpace.has(parsed.cleanId)) return userSpace.req(parsed.cleanId);
    throw new Error(`module "${parsed.cleanId}" is missing from url "${toUrl(mId)}"`);
  })
  .catch(err => {
    console.error(`could not load module "${parsed.cleanId}" from remote`); // eslint-disable-line no-console
    throw err;
  });
}
function runtimeReq ( mId ) { const parsed = parse ( mId ) ; return _fetch ( parsed . cleanId ) . then ( response => { // ensure default user space define . switchToUserSpace ( ) ; for ( let i = 0 , len = _translators . length ; i < len ; i ++ ) { const result = _translators [ i ] ( parsed , response ) ; if ( result && typeof result . then === 'function' ) return result ; } throw new Error ( ` ${ parsed . cleanId } ` ) ; } ) . then ( ( ) => { if ( userSpace . has ( parsed . cleanId ) ) return userSpace . req ( parsed . cleanId ) ; throw new Error ( ` ${ parsed . cleanId } ${ toUrl ( mId ) } ` ) ; } ) . catch ( err => { console . error ( ` ${ parsed . cleanId } ` ) ; // eslint-disable-line no-console throw err ; } ) ; }
incoming id is already mapped return a promise
incoming id is already mapped return a promise