network-detector
v1.0.2
Published
check the network is online or offline
Downloads
4
Readme
Welcome to Network Checker!
This package allows you to implement the functionalities that need internet availability. Through this package you can hold the API request when the internet restored the API request will done. Or you can perform other functionalities
Installation
NPM
npm install network-detector
YARN
yarn add network-detector
Usage
import { useNetworkStatus } from "network-detector";
const App = ( ) => {
const isOnline=useNetworkStatus(); console.log('====>',isOnline);
//The console value is true/false.. return ( //write code according to you.. )
}
export default App;
Explanation:
The useNetworkStatus hook return the boolean value. On the basis of true or false you can perform your functionality.