![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
fitbit-gestures
Advanced tools
This library allows you to detect different gestures in Fitbit apps. Tested only on Fitbit SDK 5.0
Install the library with npm i fitbit-gestures
or yarn add fitbit-gestures
Swipe, Double Tap (More gestures soon)
You must provide an Element or the ID of an existing element.
Warning
Keep in mind that only one listener can be attached to each element. Attaching multiple detectors to the same element will overwrite the previous ones.
For each gesture, you can customize the detectors. View Single Gesture examples below.
import { GestureDetector } from 'fitbit-gestures';
// Get the element. You can also pass the element ID
const element = document.getElementById('screen');
const detector = new GestureDetector(element)
.onSwipe((dir: SWIPE_DIR) => {
//Do something
})
.onDoubleTap(() => {
//Do something
});
If you only need one type of gesture, it will be slightly faster to use a dedicated class.
import { SwipeDetector, SWIPE_DIR, SwipeConfig } from 'fitbit-gestures';
// Get the element. You can also pass the element ID as string
const element = document.getElementById('screen');
//OPTIONAL configuration
const swipeConfig: SwipeConfig = {
threshold: 100
};
const detector = new SwipeDetector(element, onSwipe.bind(this), swipeConfig);
function onSwipe(direction: SWIPE_DIR) {
if(SWIPE_DIR.DOWN) {
//Do something
}
}
Attribute | Description | Default |
---|---|---|
threshold | Distance (in pixels) required to trigger the event | 100px |
import { DoubleTapDetector, DoubleTapConfig } from 'fitbit-gestures';
// Get the element. You can also pass the element ID as string
const element = document.getElementById('screen');
const doubleTapConfig: DoubleTapConfig = {
interval: 250
}
const detector = new DoubleTapDetector(element, onDoubleTap.bind(this), doubleTapConfig);
function onDoubleTap() {
//Do something
}
Attribute | Description | Default |
---|---|---|
interval | Time (in ms) required to trigger the event | 250ms |
FAQs
Library to detect gestures on Fitbit devices
The npm package fitbit-gestures receives a total of 0 weekly downloads. As such, fitbit-gestures popularity was classified as not popular.
We found that fitbit-gestures demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.