src/index.js
function resolveRequest({ requestKey, res, err }) {
  const handlers = requests[requestKey] || [];

  handlers.forEach(handler => {
    if (res) {
      handler.resolve(res);
    } else {
      handler.reject(err);
    }
  });

  // This list of handlers has been, well, handled. So we
  // clear the handlers for the next request.
  requests[requestKey] = null;
}
function resolveRequest({ requestKey, res, err }) {
  const handlers = requests[requestKey] || [];

  handlers.forEach(handler => {
    if (res) {
      handler.resolve(res);
    } else {
      handler.reject(err);
    }
  });

  // This list of handlers has been, well, handled. So we
  // clear the handlers for the next request.
  requests[requestKey] = null;
}
function resolveRequest ( { requestKey , res , err } ) { const handlers = requests [ requestKey ] || [ ] ; handlers . forEach ( handler => { if ( res ) { handler . resolve ( res ) ; } else { handler . reject ( err ) ; } } ) ; // This list of handlers has been, well, handled. So we // clear the handlers for the next request. requests [ requestKey ] = null ; }
This loops through all of the handlers for the request and either resolves or rejects them.
This loops through all of the handlers for the request and either resolves or rejects them .