web
web copied to clipboard
Pr/use battery
Hook description
- useBattery Hook - uses Navigator.getBattery() to get device battery status.
Valid use-case for the hook
- A full-screen immersive video player which can show a minimal battery status indicator instead of user having to check manually
Checklist
- [x] Have you read the contribution guidelines?
- [x] If you are porting a hook from
react-use, have you checked #33 and the migration guide to confirm that the hook has been approved for porting? - [x] Does the code have comments in hard-to-understand areas?
- [ ] Is there an existing issue for this PR?
- link issue here
- [x] Have the files been linted and formatted?
- [x] Have the docs been updated?
- [x] Have you written tests for the new hook?
- [x] Have you run the tests locally to confirm they pass?