Refactoring API call with promise using async/await

Michael S
1 min readDec 31, 2018

API call using async/await

  1. Using promise

2. Using async/await

async onSearchSubmit(term) {  const response = await axios    .get('', {      params: { query: term },      headers: {        Authorization: 'Client-ID

Reference :

  3. Modern React with Redux by Stephen Grider

I am blogging what I’ve learned to find later here for myself. If you happened to read this shit and there is wrong information, it would be appreciated to add a comment below.