Skip to content

Commit bac77ec

Browse files
committed
initial release
1 parent 1124aec commit bac77ec

File tree

5 files changed

+317
-0
lines changed

5 files changed

+317
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
React Service Worker
2+
=========
3+
4+
Simple and powerful alternative for the default create-react-app registerServiceWorker
5+
6+
## Installation
7+
8+
npm install react-service-worker -S
9+
10+
## Usage
11+
12+
the default `registerServiceWorker` generated by `create-react-app` is very simple and only gives you ways to register and unregister your service worker. Any other action should be implemented manually.
13+
14+
The `react-service-worker` module provides better organization and more features like listen for updates on your APP easily.
15+
16+
The integration is very simple, just open the `src/index` file in your project and replace
17+
18+
import registerServiceWorker from './registerServiceWorker';
19+
20+
for:
21+
22+
import registerServiceWorker from 'react-service-worker';
23+
24+
and done! This way, the react service worker will act just like the default registerServiceWorker.
25+
26+
## Tests
27+
28+
`npm test`

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
/**
4+
* The default register service worker function
5+
*/
6+
function registerServiceWorker() {
7+
// TODO
8+
}
9+
10+
export default registerServiceWorker;

package-lock.json

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "react-service-worker",
3+
"version": "0.1.0",
4+
"description": "Simple and powerful alternative for the default create-react-app registerServiceWorker",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "mocha --reporter spec"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/maxjf1/react-service-worker.git"
12+
},
13+
"keywords": [
14+
"react",
15+
"service",
16+
"worker",
17+
"sw",
18+
"create-react-app"
19+
],
20+
"author": "Maxwell Souza <[email protected]> (https://github.com/maxjf1)",
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/maxjf1/react-service-worker/issues"
24+
},
25+
"homepage": "https://github.com/maxjf1/react-service-worker#readme",
26+
"devDependencies": {
27+
"chai": "^4.1.2",
28+
"mocha": "^5.2.0"
29+
}
30+
}

test/test.js

Whitespace-only changes.

0 commit comments

Comments
 (0)