How to use the @angular/service-worker/worker.cacheFromNetworkOp function in @angular/service-worker

To help you get started, we’ve selected a few @angular/service-worker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / mobile-toolkit / service-worker / worker / src / plugins / external / index.ts View on Github external
      .map(url => cacheFromNetworkOp(this.worker, url.url, this.cacheKey)));
  }
github angular / mobile-toolkit / service-worker / worker / src / plugins / static / index.ts View on Github external
.then(resp => {
          if (!!resp) {
            LOG.technical(`setup(${this.cacheKey}, ${url}): no need to refresh ${url} in the cache`);
            return null;
          }
          LOG.technical(`setup(${this.cacheKey}, ${url}): caching from network`);
          return cacheFromNetworkOp(this.worker, url, this.cacheKey, shouldCacheBust(url))();
        })
      }