Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/excaliburhan/visibility-wrapper
A wrapper use for visilibity-js
https://github.com/excaliburhan/visibility-wrapper
visibility
Last synced: about 1 month ago
JSON representation
A wrapper use for visilibity-js
- Host: GitHub
- URL: https://github.com/excaliburhan/visibility-wrapper
- Owner: excaliburhan
- Created: 2018-09-03T04:42:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T13:18:14.000Z (over 6 years ago)
- Last Synced: 2024-11-21T10:38:10.407Z (about 1 month ago)
- Topics: visibility
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# visibility-wrapper
A wrapper use for visilibity-js## Usage
```js
import { VisibilityChange, VisibilityStop } from 'visibility-wrapper'VisibilityChange((state) => {
console.log(state)
})// if browser do not support Visibility API, it will use Visibility.every from visivility-js, and return its timer id, don't forget to clear it when your page is destroyed
const id = VisibilityChange((state) => {
console.log(state)
})// when page is destroyed
VisibilityStop(id)
```