https://github.com/afeiship/react-sw-updater
A react pwa updater based on sw-runtime.
https://github.com/afeiship/react-sw-updater
checker component pwa rc react runtime service-worker sw sw-runtime updater
Last synced: about 1 month ago
JSON representation
A react pwa updater based on sw-runtime.
- Host: GitHub
- URL: https://github.com/afeiship/react-sw-updater
- Owner: afeiship
- License: mit
- Created: 2019-05-20T01:56:58.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T23:52:58.000Z (7 months ago)
- Last Synced: 2025-02-07T13:23:33.265Z (3 months ago)
- Topics: checker, component, pwa, rc, react, runtime, service-worker, sw, sw-runtime, updater
- Language: TypeScript
- Homepage:
- Size: 177 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# react-sw-updater
> A react pwa updater based on sw-runtime.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install -S @jswork/react-sw-updater
```## usage
1. import css
```scss
@import "~@jswork/react-sw-updater/dist/style.css";// or use sass
@import "~@jswork/react-sw-updater/dist/style.scss";
```
2. import js
```js
import ReactSwUpdater from '@jswork/react-sw-updater';
import '@jswork/react-sw-updater/dist/style.scss';function App() {
return (
Build Time: {BUILD_TIME}
{
const confirmed = confirm('New version available, do you want to update?');
execute(confirmed);
}}
/>
);
}export default App;
```## preview
- https://afeiship.github.io/react-sw-updater/## license
Code released under [the MIT license](https://github.com/afeiship/react-sw-updater/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/react-sw-updater
[version-url]: https://npmjs.org/package/@jswork/react-sw-updater[license-image]: https://img.shields.io/npm/l/@jswork/react-sw-updater
[license-url]: https://github.com/afeiship/react-sw-updater/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-sw-updater
[size-url]: https://github.com/afeiship/react-sw-updater/blob/master/dist/react-sw-updater.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/react-sw-updater
[download-url]: https://www.npmjs.com/package/@jswork/react-sw-updater