UNPKG

rc-hammer

Version:

use hammerjs in React/ReactNative

25 lines (24 loc) 504 B
import { DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN } from '../inputjs/input-consts'; /** * @private * direction cons to string * @param {constant} direction * @returns {String} */ export default function directionStr(direction) { if (direction === DIRECTION_DOWN) { return 'down'; } else if (direction === DIRECTION_UP) { return 'up'; } else if (direction === DIRECTION_LEFT) { return 'left'; } else if (direction === DIRECTION_RIGHT) { return 'right'; } return ''; }