0.1.2 • Published 4 years ago

svelte-internet-connection v0.1.2

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

Svelte Internet Connection

npm version License: MIT Build Status Netlify Status

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

PropTypeDescription
changefuncCall with change connection

Slot Properties

PropTypeDescription
statusstringConnection status
onlineboolTells if there is a connection
offlineboolTells if there is no connection

NPM Statistics

Download stats for this NPM package

NPM

License

Svelte Internet Connection is open source software licensed as MIT.