docs: function resolveStaleWhileRevalidateEntry (service, entryKey, cache, ctx) {
    // NOTE: pulling through module.exports allows us to test if they were called
    const {
      resolveStaleWhileRevalidate,
      isRevalidatingCacheKey,
      shouldTriggerRevalidate,
      revalidateEntry
    } = module.exports
  
    // IMPORTANT: we only want to bypass an entity that is being revalidated and
    // that matches the same cache entry key, otherwise all child entities will
    // be needlesly resolved
    if (isRevalidatingCacheKey(ctx, entryKey)) {
      // bypass the rest forces entity to get resolved
      return undefined
    }
  
    const staleWhileRevalidate = resolveStaleWhileRevalidate(service)
  
    // cleanup on a new tick so it does not block current process, the clear
    // method is throttled for performance
    setTimeout(staleWhileRevalidate.invalidateLocalFlags, 0)
  
    const tasks = [
      staleWhileRevalidate.getRevalidationState(entryKey),
      staleWhileRevalidate.getEntry(entryKey)
    ]
  
    return Promise.all(tasks).then(results => {
      const revalidationState = results[0]
      const staleEntry = results[1]
  
      if (shouldTriggerRevalidate(staleEntry, revalidationState)) {
        // IMPORTANT: revalidateEntry operates on a new thread
        revalidateEntry(service, entryKey, cache, ctx)
      } // Otherwise means its a cold start and must be resolved outside
  
      // return stale entry regardless
      return staleEntry
    })
  }