Created
May 30, 2016 18:28
-
-
Save andywarr/97a29052c0f194701546d2146d3c7e3e to your computer and use it in GitHub Desktop.
Detect AWS clickType
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uberx_id = 'a1111c8c-c720-46c3-8534-2fcdd730040d'; // UberX SF | |
const uberblack_id = 'd4abaae7-f4d6-4152-91cc-77523e8165a4'; // UberBlack SF | |
const single_click = 'SINGLE'; | |
const double_click = 'DOUBLE'; | |
const long_click = 'LONG'; | |
function callUber(event, context) { | |
if (event.clickType === single_click) { | |
requestUber(event, context, uberx_id) | |
} | |
else if (event.clickType === double_click) { | |
requestUber(event, context, uberblack_id) | |
} | |
else if (event.clickType === long_click) { | |
cancelUber(event, context); | |
} | |
else { | |
context.fail(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment