Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default ({ x, y, ...props }: PointerProps = {}): Action => {
if (x !== undefined || y !== undefined) {
const applyXOffset = applyOffset(x || 0);
const applyYOffset = applyOffset(y || 0);
const delta = { x: 0, y: 0 };
return pointer(props).pipe((point: Point2D) => {
delta.x = applyXOffset(point.x);
delta.y = applyYOffset(point.y);
return delta;
});
} else {
return pointer(props);
}
};
export default ({ x, y, ...props }: PointerProps = {}): Action => {
if (x !== undefined || y !== undefined) {
const applyXOffset = applyOffset(x || 0);
const applyYOffset = applyOffset(y || 0);
const delta = { x: 0, y: 0 };
return pointer(props).pipe((point: Point2D) => {
delta.x = applyXOffset(point.x);
delta.y = applyYOffset(point.y);
return delta;
});
} else {
return pointer(props);
}
};