Skip to content

Instantly share code, notes, and snippets.

@jnsdls
Created September 13, 2016 08:43
Show Gist options
  • Save jnsdls/a09cda52b68a903e5836e325de090af5 to your computer and use it in GitHub Desktop.
Save jnsdls/a09cda52b68a903e5836e325de090af5 to your computer and use it in GitHub Desktop.
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