kripod / kripod/react-hooks

Leverage capabilities of the new Generic Sensor API

Open
#22 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
557
Forks
25
PR merge metrics
No merged PRs in 30d

Description

## Motivation

The [Generic Sensor API](https://www.w3.org/TR/generic-sensor/) features a base [Sensor](https://w3c.github.io/sensors/#the-sensor-interface) interface to build detectors upon. It would deprecate the following hooks:

- useDeviceMotion
- useDeviceOrientation

Currently, the [browser support is low](https://caniuse.com/#feat=mdn-api_sensor), but [polyfills](https://github.com/kenchris/sensor-polyfills) are available.

## Details

- [Sensors for the Web! - Google Developers](https://developers.google.com/web/updates/2017/09/sensors-for-the-web)
- [Generic Sensor API playground](https://intel.github.io/generic-sensor-demos/)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing useDeviceMotion and useDeviceOrientation hooks, then compare their responsibilities with the Generic Sensor API Sensor interface and the linked browser-support and polyfill references. Done means the supported sensor approach and deprecation scope are clearly defined and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.