Created
June 15, 2018 02:03
-
-
Save dceddia/b02112b2dde5f586a5513f5e6d018883 to your computer and use it in GitHub Desktop.
Take a picture after 30 seconds.
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 PHOTO_INTERVAL = 30000; | |
const FOCUS_TIME = 3000; | |
class Autoshoot extends React.Component { | |
componentDidMount() { | |
this.countdown = setTimeout( | |
this.takePicture, | |
PHOTO_INTERVAL | |
); | |
} | |
componentWillUnmount() { | |
clearInterval(this.countdown); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment