Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/i-m-hossain/online-checker
An npm module
https://github.com/i-m-hossain/online-checker
customhook module npm react
Last synced: 23 days ago
JSON representation
An npm module
- Host: GitHub
- URL: https://github.com/i-m-hossain/online-checker
- Owner: i-m-hossain
- Created: 2023-01-28T06:02:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-28T08:30:09.000Z (almost 2 years ago)
- Last Synced: 2024-09-15T07:20:53.183Z (about 2 months ago)
- Topics: customhook, module, npm, react
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# online-checker
A custom react hook to track if the browser goes offline. This hook simply returns true or false of the current browsers online status. This is very useful if we want to render a view depending on browsers online status.
## How to use
- `npm install`
You can now import `online-checker` like so:
```
import useOnLineChecker from 'online-checker'
...
**Notice this is a default export**
...
Then use that inside script just like a normal React hook
...
const isOnLine = useOnLineChecker(); //returns true or false
```