title: React count array in API and reset / start again
body: <p>Hi Everyone I have been trying to create a Rota in React that uses a API of staff members below is the code I have been using. At the moment this reads the array and then adds a random number to the state every 3s. </p>
  
  <p>What I want it to do is count from 0 to the value of the array and then reset. Any ideas? </p>
  
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  import axios from 'axios';
  import { once, every, daily } from 'bella-scheduler';
  
  class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            data: [0]
        }
    }
  
    componentDidMount() {
        axios.get('http://localhost:3333/staff')
        .then((response) =&gt; {
            this.successShow(response);
        })
        .catch((error) =&gt; {
            this.successShow('error');
        });
    }
  
  
    successShow(response) {
          console.log(response.data);
  
          every('3s', () =&gt; {
  
              var i = Math.floor(Math.random()*(response.data.length))
              this.setState({person: response.data[i].name});
              console.log('Resolved task.');
  
          });
  
      }
  
  
    render() {
        return (
            &lt;div className="main"&gt;
              &lt;h2 className="title"&gt;Rota&lt;/h2&gt;
              &lt;h3&gt;{this.state.person}&lt;/h3&gt;
            &lt;/div&gt;
        );
    }
  }
  
  
  export default App;
  </code></pre>