{"size": 699, "ext": "js", "max_stars_repo_path": "src/utils/BeerAPI.js", "max_stars_repo_name": "chingu-voyage7/Geckos-Team-10", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/BeerAPI.js", "max_issues_repo_name": "chingu-voyage7/Geckos-Team-10", "max_issues_repo_issues_event_min_datetime": "2018-11-30T06:33:10.000Z", "max_issues_repo_issues_event_max_datetime": "2019-06-28T02:03:40.000Z", "max_forks_repo_path": "src/utils/BeerAPI.js", "max_forks_repo_name": "chingu-voyage7/Geckos-Team-10", "max_forks_repo_forks_event_min_datetime": "2018-12-11T01:37:37.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-13T05:37:05.000Z"}
{"max_stars_count": null, "max_issues_count": 20, "max_forks_count": 3, "avg_line_length": 24.9642857143, "max_line_length": 67, "alphanum_fraction": 0.5751072961}
import axios from 'axios';

const root_api = 'https://api.punkapi.com/v2/beers';

const getBeers = async () => {
  try {
    return await axios
      .all([
        axios.get(`${root_api}?page=1&per_page=80`),
        axios.get(`${root_api}?page=2&per_page=80`),
        axios.get(`${root_api}?page=3&per_page=80`)
      ])
      .then(
        axios.spread(function(data1, data2, data3) {
          let beerData1 = data1.data;
          let beerData2 = data2.data;
          let beerData3 = data3.data;
          let master_data = beerData1.concat(beerData2, beerData3);
          return master_data;
        })
      );
  } catch (error) {
    console.log(error);
  }
};

export default getBeers;
