Created
September 10, 2020 17:50
-
-
Save MikeFielden/b42e4b96800ca70d2c63b3e408e5411a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Api() {} | |
Api.prototype.fetchUsers = async function () { | |
const users = await getUsersFromApi(); | |
return users; | |
}; | |
Api.prototype.fetchProfileImg = async function (user) { | |
const profileImg = await getProfileImgFromUser(user); | |
return profileImg; | |
}; | |
const api = new Api(); | |
const users = await api.fetchUsers(); | |
const profileImg = await api.fetchProfileImg(users[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment