1.0.12 • Published 5 months ago

restful-queue v1.0.12

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

restful-queue

A queue for service workers which send requests to a restful API

Basic usage

Add the following to your service worker to use the queue for all non-GET requests:

import { queueAndAttemptRequest } from 'restful-queue';

self.addEventListener('fetch', event => {
	if (event.request.method !== 'GET') {
		event.respondWith(queueAndAttemptRequest(event.request));
	} else {
		... // Handle GET requests here, eg return them from cache
	}
});

See also

Unit Testing

Run:

npm test

Publish to npm

Automatically publishes on the main branch

Make sure to bump the version number in package.json. (Can use npm version ${version_number}).

1.0.9

7 months ago

1.0.8

8 months ago

1.0.11

6 months ago

1.0.10

7 months ago

1.0.12

5 months ago

1.0.7

8 months ago

1.0.6

9 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.2

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.3

11 months ago

0.0.3

1 year ago

0.0.9

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago

0.0.1

3 years ago