https://github.com/andrelmlins/svelte-internet-connection
Internet connection detector to Svelte
https://github.com/andrelmlins/svelte-internet-connection
detector internet-connection offline online svelte
Last synced: about 2 months ago
JSON representation
Internet connection detector to Svelte
- Host: GitHub
- URL: https://github.com/andrelmlins/svelte-internet-connection
- Owner: andrelmlins
- License: mit
- Created: 2020-04-13T01:15:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:17:06.000Z (over 2 years ago)
- Last Synced: 2024-12-22T19:05:50.858Z (6 months ago)
- Topics: detector, internet-connection, offline, online, svelte
- Language: Svelte
- Homepage: https://svelte-internet-connection.netlify.com/
- Size: 586 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-svelte - Svelte Internet Connection - Detector de conexão com a internet. (UI Componentes / Comunidade Global)
README
# Svelte Internet Connection
[](https://www.npmjs.com/package/svelte-internet-connection) • [](https://github.com/andrelmlins/svelte-internet-connection/blob/master/LICENSE) • [](https://travis-ci.com/andrelmlins/svelte-internet-connection) • [](https://app.netlify.com/sites/svelte-internet-connection/deploys)
Internet connection detector to Svelte
## Installation
```
npm i svelte-internet-connection
// OR
yarn add svelte-internet-connection
```Note: to use this library in sapper, install as devDependency. See the [link](https://github.com/sveltejs/sapper-template#using-external-components).
## Demo [Link](https://svelte-internet-connection.netlify.com/)
Local demo:
```
git clone https://github.com/andrelmlins/svelte-internet-connection.git
cd svelte-internet-connection
npm install && npm run dev
```## Examples
An example of how to use the library:
```js
import InternetConnection from "svelte-internet-connection";
Status: {status}
```
## Events
| Prop | Type | Description |
| ------ | ---- | --------------------------- |
| change | func | Call with change connection |## Slot Properties
| Prop | Type | Description |
| ------- | ------ | ------------------------------- |
| status | string | Connection status |
| online | bool | Tells if there is a connection |
| offline | bool | Tells if there is no connection |## NPM Statistics
Download stats for this NPM package
[](https://nodei.co/npm/svelte-internet-connection/)
## License
Svelte Internet Connection is open source software [licensed as MIT](https://github.com/andrelmlins/svelte-internet-connection/blob/master/LICENSE).