react-use
react-use copied to clipboard
feat(wakelock): adds useWakeLock hook
Description
Screen wakelock is a feature which is part of the capabilities being developed as part of project fugu . It lets a website prevents the device screen from going dark once the lock is acquired. The lock is controlled by some external factors as well
- Battery percentage left on the device
- visibility of the browser tab
- power saver mode on the device.
support : https://caniuse.com/wake-lock
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as before)
Checklist
- [x] Read the Contributing Guide
- [ ] Perform a code self-review
- [ ] Comment the code, particularly in hard-to-understand areas
- [x] Add documentation
- [x] Add hook's story at Storybook
- [ ] Cover changes with tests
- [ ] Ensure the test suite passes (
yarn test
) - [ ] Provide 100% tests coverage
- [x] Make sure code lints (
yarn lint
). Fix it withyarn lint:fix
in case of failure. - [x] Make sure types are fine (
yarn lint:types
).
Awaiting review from maintainers. If this feature is worthwhile to add , will add necessary tests to complete the PR
Thank you for making this PR. I just used the code to implement a wake-lock feature. What is up with this not being merged for two years?