Skip to content

Instantly share code, notes, and snippets.

@dceddia dceddia/App.js
Created Jun 15, 2018

Embed
What would you like to do?
Take a picture after 30 seconds.
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
You can’t perform that action at this time.