Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-gesture-helper
Advanced tools
Readme
A small library that adds returns gesture type when gestureState, the velocity threshold and the directional offset threshold is passed from the React Native pan responder.
npm install react-native-gesture-helper --save
Depending on the velocityThreshold and directionalOffsetThreshold the library will return wether or not the gestures is a swipe or a pan.
import React, {Component} from 'react';
import getGestureType from 'react-native-gesture-helper';
class SomeComponent extends Component {
componentWillMount: function() {
this._panResponder = PanResponder.create({
onPanResponderMove: (evt, gestureState) => {
// Add the gesture detection.
const velocityThreshold = 0.4;
const directionalOffsetThreshold = 80;
const swipeDirection = getGestureType(gestureState, velocityThreshold, directionalOffsetThreshold);
// Do what you will with the results here...
}
});
}
}
Param | Default | type | description |
---|---|---|---|
gestureState | null | Object | The gestureState value returned from the react Native PanResponder api |
velocityThreshold | 0.4 | Number | The Velocity threshold that decides wether the gesture is a swipe or a pan |
directionalOffsetThreshold | 80 | Number | The directional offset threshold of the gesture |
Based on the input the response returned fro the gesture should be one of the following.
npm test
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Feel free to contact me in twitter or create an issue
FAQs
A gesture helper for React Native
The npm package react-native-gesture-helper receives a total of 128 weekly downloads. As such, react-native-gesture-helper popularity was classified as not popular.
We found that react-native-gesture-helper 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.