0.3.0 • Published 6 years ago

workbox-bgsync v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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

0.3.0

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.1

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago