svelte-internet-connection

0.1.2 • Public • Published

Svelte Internet Connection

npm versionLicense: MITBuild StatusNetlify 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

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

License

Svelte Internet Connection is open source software licensed as MIT.

Package Sidebar

Install

npm i svelte-internet-connection

Weekly Downloads

5

Version

0.1.2

License

MIT

Unpacked Size

22 kB

Total Files

6

Last publish

Collaborators

  • andrelmlins