After trying out
const fetchUsers = async (user) => {
const api_call = await
// Joined string and variables by Template Literal
fetch(`https://api.github.com/users/${user}?client_id=${client_id}&client_secret=${client_secret}`);
const data = await api_call.json();
return { data }
}
Dev env:
1. SASS
2. Vanilla JS
Demo: https://dist-lqxmlrwupp.now.sh/
Screenshot
References:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await