Created
June 15, 2018 02:03
-
-
Save dceddia/15f551ac1b0888fbb4bcb8fdb6f1445c to your computer and use it in GitHub Desktop.
Timers trigger more timers.
This file contains hidden or 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
takePicture = () => { | |
this.camera.takePictureAsync({ | |
quality: 0.1, | |
base64: true, | |
exif: false | |
}).then(photo => { | |
this.setState({ photo }); | |
// In 27 seconds, turn the camera back on | |
setTimeout(() => { | |
this.setState({ photo: null }); | |
}, PHOTO_INTERVAL - FOCUS_TIME); | |
// In 30 seconds, take the next picture | |
setTimeout(this.takePicture, PHOTO_INTERVAL); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment