Skip to content

Instantly share code, notes, and snippets.

@dceddia
Created June 15, 2018 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dceddia/b02112b2dde5f586a5513f5e6d018883 to your computer and use it in GitHub Desktop.
Save dceddia/b02112b2dde5f586a5513f5e6d018883 to your computer and use it in GitHub Desktop.
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