@pranitdeshpande98/useonlinestatus_hook

1.0.0 • Public • Published

@pranitdeshpande98/useonlinestatus

Introduction

@pranitdeshpande98/useonlinestatus is a custom React hook designed to detect the online status of the user's browser. It provides a seamless way to monitor whether the user's device is connected to the internet.

Installation

You can install @pranitdeshpande98/useonlinestatus via npm or yarn:

npm install @pranitdeshpande98/useonlinestatus
or

bash
yarn add @pranitdeshpande98/useonlinestatus
Usage
To use the @pranitdeshpande98/useonlinestatus hook in your React components, import it and invoke it with the desired timeout value (in milliseconds).
The hook returns a boolean value indicating whether the user's device is currently connected to the internet.

Parameters
timeout: The timeout value in milliseconds. After the specified time of inactivity, the user will be considered offline.
Example
You can find a simple example of how to use @pranitdeshpande98/useonlinestatus in the example directory of this repository.

License
This project is licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @pranitdeshpande98/useonlinestatus_hook

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

2.39 kB

Total Files

3

Last publish

Collaborators

  • pranitdeshpande98