svelte-internet-connection
v0.1.2
Published
Internet connection detector to Svelte
Downloads
5
Maintainers
Readme
Svelte Internet Connection
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.
Demo Link
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:
<script>
import InternetConnection from "svelte-internet-connection";
</script>
<InternetConnection let:status>
Status: {status}
</InternetConnection>
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
License
Svelte Internet Connection is open source software licensed as MIT.