JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q41042F
  • License MIT

Package to view the background requests rasied by workbox.

Package Exports

  • workbox-bgsync

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (workbox-bgsync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Workbok-bgSync

npm npm

Adds a react component to list the offline requests made by workbox's backgroundSync.

Getting Started

The package comes with a script to be added in your service worker and a react component.

Prerequisites

A service worker with workbox registed and active.

eg:

importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.2.0/workbox-sw.js');

#...
#Precache
#...

Installing

Service Worker

Add the script to your service woker after workbox

importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.2.0/workbox-sw.js');
importScripts('https://rawgit.com/abhiagri/workbox-bgsync/master/dist/sw.js');

...

You can also download the file and import it locally

Register Routes
const bgSync = bgSyncPlugin('queueName');
workbox.routing.registerRoute(
  /\/api\/.*/,
  workbox.strategies.networkOnly({
    plugins: [bgSync],
  }),
  'POST',
);

React Component

npm install workbox-bgsync
import Requests from 'workbox-bgsync'

...

render() {
    return <Requests />
}

Authors

  • Abhishek Lal - Initial work - GitHub

License

This project is licensed under the MIT License