async/await Collections

A demonstration of different ways to run a set of asynchronous operations with async/await.

Babel + JSX

async function asyncSay(name){
	return new Promise((resolve, reject) => {
    resolve(`My name is ${name}`)
  })
}

async function sayMyName(name){
	const result = await asyncSay(name);
  return result;
}

(async () => {
	console.log(await sayMyName('Dou Jain'))
})()