You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
515 B
26 lines
515 B
import {
|
|
STATE_CANCELLED,
|
|
STATE_ENDED,
|
|
STATE_CHANGED,
|
|
STATE_BEGAN
|
|
} from './recognizer-consts';
|
|
|
|
/**
|
|
* @private
|
|
* get a usable string, used as event postfix
|
|
* @param {constant} state
|
|
* @returns {String} state
|
|
*/
|
|
export default function stateStr(state) {
|
|
if (state & STATE_CANCELLED) {
|
|
return 'cancel';
|
|
} else if (state & STATE_ENDED) {
|
|
return 'end';
|
|
} else if (state & STATE_CHANGED) {
|
|
return 'move';
|
|
} else if (state & STATE_BEGAN) {
|
|
return 'start';
|
|
}
|
|
return '';
|
|
}
|