15.5.3 • Published 4 years ago

@the-/util-sw v15.5.3

Weekly downloads
496
License
MIT
Repository
github
Last release
4 years ago

@the-/util-sw

npm Version

Utility for service workers

Installation

$ npm install @the-/util-sw --save

Usage

'use strict'

const { appCache, cachingFetch } = require('@the-/util-sw')

async function tryExample() {
  self.addEventListener('fetch', (event) => {
    event.respondWith(
      (async function() {
        const cache = await appCache('my-site', 'v1.0.0')
        return cachingFetch(cache, event.request)
      })(),
    )
  })
}

tryExample().catch((err) => console.error(err))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

15.5.3

4 years ago

15.5.2

4 years ago

15.5.1

5 years ago

15.5.0

5 years ago

15.4.0

5 years ago

15.2.0

5 years ago

15.1.4

5 years ago

15.1.3

5 years ago

15.1.2

5 years ago

15.1.0

5 years ago

15.0.3

5 years ago