title: Creation of polling with axios and React
body: <p>I am trying to implement axios poling with React. I am expecting the get request to return a certain value but because it's async method I have to wait for it. </p>
  
  <p>React method:</p>
  
  <pre><code> getInformationMessageOnSubmit = () =&gt; {
       getInformationMessage().then(output =&gt; 
       this.setState({message: output})
    };
  </code></pre>
  
  <p>And I also have an axios request in a different file:</p>
  
  <pre><code>const getInfo = () =&gt; {
    return axios.get('url')
      .then(output =&gt; output)
      .catch(error =&gt; console.log(error))
  }
  
  
  export const getInformationMessage = sealId =&gt; {
    setInterval(() =&gt; getInfo(sealId), 1000);
  };
  </code></pre>