Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 17 hours 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:17:06.000Z (almost 2 years ago)
- Last Synced: 2024-06-11T18:06:17.673Z (5 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
[![npm version](https://badge.fury.io/js/svelte-internet-connection.svg)](https://www.npmjs.com/package/svelte-internet-connection) • [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/svelte-internet-connection/blob/master/LICENSE) • [![Build Status](https://travis-ci.com/andrelmlins/svelte-internet-connection.svg?branch=master)](https://travis-ci.com/andrelmlins/svelte-internet-connection) • [![Netlify Status](https://api.netlify.com/api/v1/badges/364c1465-8483-410d-9ffd-db4a6b09134e/deploy-status)](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
[![NPM](https://nodei.co/npm/svelte-internet-connection.png)](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).