Use setInterval

This commit is contained in:
Jordan Eldredge 2018-04-14 12:31:29 -07:00
parent 1167c8526d
commit 91cd4d1dd3

View file

@ -76,15 +76,11 @@ class Marquee extends React.Component {
}
componentDidMount() {
const step = () => {
this.stepHandle = setTimeout(() => {
if (this.state.stepping) {
this.props.dispatch({ type: STEP_MARQUEE });
}
step();
}, 220);
};
step();
this.stepHandle = setInterval(() => {
if (this.state.stepping) {
this.props.dispatch({ type: STEP_MARQUEE });
}
}, 220);
}
componentWillUnmount() {