Created
September 13, 2016 08:43
-
-
Save jnsdls/a09cda52b68a903e5836e325de090af5 to your computer and use it in GitHub Desktop.
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
switchCamera() { | |
this.props.switchCamera() // yup, we literally just call it on the <App /> | |
} | |
// hey, let's also let users double-tap to flip the camera around | |
let prevDate = Date.now(); // set this up once | |
evalDoubleTap() { | |
const newDate = Date.now(); // | |
if(newDate < prevDate + 200) { // if 2 taps happen within 200ms of each other, it's a double tap | |
this.switchCamera(); | |
} | |
prevDate = newDate; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment