import axios from "axios"; const id = "b2226ece2b6fce3bb116"; const sec = "be0525b65ff757d7e70e19589655fe5a41d4e2aa"; const param = `?client_id=${id}&client_secret=${sec}`; function getUserInfo(username) { return axios.get(`https://api.github.com/users/${username}${param}`); } const helpers = { getPlayersInfo(players) { // fetch some data from Github return axios.all(players.map((username) => { return getUserInfo(username); })).then((info) => { return info.map((item) => { return item.data; }); }).catch((err) => { console.warn("Error in getPlayerInfo", err); }); } }; export default helpers;