Skip to content

Commit

Permalink
feat(👋🏻): Exposes x and y values via panGestureHandler() (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Oct 4, 2019
1 parent 92e41b8 commit b30b764
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Gesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,27 @@ export const onGestureEvent = (
};

export const panGestureHandler = () => {
const x = new Value(0);
const translationX = new Value(0);
const velocityX = new Value(0);
const y = new Value(0);
const translationY = new Value(0);
const velocityY = new Value(0);
const state = new Value(State.UNDETERMINED);
const gestureHandler = onGestureEvent({
x,
translationX,
velocityX,
y,
translationY,
velocityY,
state
});
return {
x,
translationX,
velocityX,
y,
translationY,
velocityY,
state,
Expand All @@ -249,6 +257,7 @@ export const panGestureHandler = () => {
};

export const horizontalPanGestureHandler = () => {
const x = new Value(0);
const translationX = new Value(0);
const velocityX = new Value(0);
const state = new Value(State.UNDETERMINED);
Expand All @@ -258,6 +267,7 @@ export const horizontalPanGestureHandler = () => {
state
});
return {
x,
translationX,
state,
velocityX,
Expand All @@ -266,15 +276,18 @@ export const horizontalPanGestureHandler = () => {
};

export const verticalPanGestureHandler = () => {
const y = new Value(0);
const translationY = new Value(0);
const velocityY = new Value(0);
const state = new Value(State.UNDETERMINED);
const gestureHandler = onGestureEvent({
y,
translationY,
velocityY,
state
});
return {
y,
translationY,
state,
velocityY,
Expand Down

0 comments on commit b30b764

Please sign in to comment.