title: Reactjs and making continuous api calls
body: <p>I am building a react app that contains sports information and therefore I need to fetch new data from the API, every few seconds. I was wondering the best way to go about that.</p>
  
  <pre><code>class App extends Component {
    constructor(props) {
      super(props);
  
  
      this.state = {
        PlayersbyTeam: ''
      }
  
    }
  
    componentDidMount(){
  
      this.callAxios()
    }
  
  
    callAxios(){
       axios.all([
              axios.get('https://api')
          ])
              .then(axios.spread((x) =&gt; {
  
  
       }))
    }
  
  
  
    render() {
      console.log(this.state)
      return (
        &lt;div className="App"&gt;
            &lt;Table  /&gt;
        &lt;/div&gt;
      );
    }
  } 
  </code></pre>