graphprotocol / research

Research, proposals, papers, and specs
48 stars 9 forks source link

Use async/await in ETL.js mappings example #11

Closed Zerim closed 6 years ago

Zerim commented 6 years ago

Using async/await instead of promises should reduce nesting and improve readability for the ETL.js example.

Zerim commented 6 years ago

After refactoring, the only remaining use of Promises is a Promise.all which cannot be replaced with an await call, which for multiple Promises still executes in series, rather than concurrently.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function