title: I want to access API using async / await
body: <p>Requirements</p>
  
  <ul>
  <li><p>I want to use a separate file for the process to access the API</p></li>
  <li><p>I want to use async / await</p></li>
  <li><p>I want to use axios</p></li>
  </ul>
  
  <p>The code below will be undefined</p>
  
  <ul>
  <li>test.js</li>
  </ul>
  
  <pre><code>import fetchApi from '../lib/store';
  
  export default function() {
  
    async function call() {
      const res = await fetchApi();
      console.log(res);//undefined
    }
    call();
  }
  </code></pre>
  
  <ul>
  <li>lib/store.js</li>
  </ul>
  
  <pre><code>import axios from "axios"
  
  export default function() {
    async function fetchApi() {
      try {
        const response = await axios.get('https://jsonplaceholder.typicode.com/todos/1');
          return response;
      } catch (error) {
          return error;
      }
    }
  }
  </code></pre>