mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
Use setInterval
This commit is contained in:
parent
1167c8526d
commit
91cd4d1dd3
1 changed files with 5 additions and 9 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue