code: function fetch(publicAPI, model, name) {
    let fetchCallback = null;
    const requestQueue = [];
  
    publicAPI[`set${capitalize(name)}FetchCallback`] = (fetchMethod) => {
      if (requestQueue.length) {
        fetchMethod(requestQueue);
      }
      fetchCallback = fetchMethod;
    };
  
    return {
      addRequest(request) {
        requestQueue.push(request);
        if (fetchCallback) {
          fetchCallback(requestQueue);
        }
      },
      resetRequests(requestList) {
        while (requestQueue.length) {
          requestQueue.pop();
        }
        if (requestList) {
          // Rebuild request list
          requestList.forEach((req) => {
            requestQueue.push(req);
          });
          // Also trigger a request
          if (fetchCallback) {
            fetchCallback(requestQueue);
          }
        }
      },
    };
  }
docs: ---------------------------------------------------------------------------- Fetch handling: setXXXFetchCallback / return { addRequest } ----------------------------------------------------------------------------