1.2.1 • Published 7 years ago

offline-component v1.2.1

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

This is a simple React component wrapper that allows you to specify a component that will be shown if the application loses network connection. It makes an AJAX request for the favicon to determine your connection.

Example usage:

import OfflineComponent from 'offline-component';

const Offline = () => <p>Your connection is not stable, please try again later</p>;

const Header = () => (
  <header>
    <h1>Brand</h1>
    <OfflineComponent interval={10000} offlineComponent={Offline}>
      <p>Description text</p>
    </OfflineComponent>
  </header>
)

The interval prop specifies how often the favicon will be queried in milliseconds. If omitted, it detaults to 5000ms.

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago