Skip to content

Instantly share code, notes, and snippets.

View Abazhenov's full-sized avatar

Alexei Bazhenov Abazhenov

View GitHub Profile
const associateUsers = async () => {
try {
doSynchronousthings()
const users = await getUsers()
return users.map(user => user.getAddress());
} catch(err){
console.error(err)
}
}
const associateUsers = () => {
try {
doSynchronousThings()
return getUsers()
.then(users => users.map(user => user.getAddress()));
.catch(e => console.error(e))
} catch(err){
console.error(err)
}
}
const getInfo = async () => {
console.log(await axios.get('/users'))
console.log(await getGroups())
console.log(await getFavorites())
return 'all done';
}
getInfo();
const getInfo = () =>
axios.get('/users')
.then(users => {
console.log(users)
})
.then(() => getGroups())
.then(groups => {
console.log(groups)
})
.then(() => getFavorites())