invalidateMatchingCache = (requestId, { invalidateUrls, invalidateUrlsRegex }) => {
  // invalidate this request
  ajaxCache.delete(requestId);
  pendingRequestStore.resolve(requestId);

  // also invalidate caches matching to invalidateUrls
  if (Array.isArray(invalidateUrls)) {
    invalidateUrls.forEach(url => {
      ajaxCache.delete(url);
      pendingRequestStore.resolve(url);
    });
  }
  // also invalidate caches matching to invalidateUrlsRegex
  if (invalidateUrlsRegex) {
    ajaxCache.deleteMatching(invalidateUrlsRegex);
    pendingRequestStore.resolveMatching(invalidateUrlsRegex);
  }
}
Invalidates matching requestIds in the cache and pendingRequestStore

There are two kinds of invalidate rules:
invalidateUrls (array of URL like strings)
invalidateUrlsRegex (RegExp)
If a non-GET method is fired, by default it only invalidates its own endpoint.
Invalidating /api/users cache by doing a PATCH, will not invalidate /api/accounts cache.
However, in the case of users and accounts, they may be very interconnected,
so perhaps you do want to invalidate /api/accounts when invalidating /api/users.
If it's NOT one of the config.methods, invalidate caches

@param {string} requestId
@param {CacheOptions} cacheOptions