P5.js-web-editor: Promisify all mongoose queries using async/await

Created on 7 Feb 2018  路  14Comments  路  Source: processing/p5.js-web-editor

Nature of issue?

  • [X] Existing feature enhancement

Feature enhancement details:

Right now, all of the mongoose queries use callbacks instead of the new ES6 promise syntax. This should be updated as nested callbacks are difficult to read.

help wanted medium task

Most helpful comment

it might be helpful to work on this in pieces, like promisify one controller at a time or something.

All 14 comments

I'm on it.

@dhruvdutt still on it?

Yeah. I've already started with it. Will be pushing by this week.

is anyone assigned to this issue?

@dhruvdutt started working on it but i don't know how far they got. feel free to start on this!

it might be helpful to work on this in pieces, like promisify one controller at a time or something.

Ah! I'm sorry, couldn't get back to this. I would be happy to review a PR.
Best of luck @migom6 :+1:

Working!

this is a big issue, so i recommend making small PR's!

@catarak As the task is huge, I too would like to contribute to this.

Are we prefer the promise .then chains, or should the code be using async/await? I would prefer the latter for readability

i definitely prefer async / await! i'll update the issue title.

We have to change the error handling mechanics with async/await , I have some links , I will post them here

There's an in-depth conversation about some of the struggles of using async-await with Express: https://github.com/processing/p5.js-web-editor/pull/973

TL;DR It makes sense to include an async middleware like express-async-handler, or update to a different Node framework, like Fastify or Koa.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hellonearthis picture hellonearthis  路  4Comments

aferriss picture aferriss  路  5Comments

meiamsome picture meiamsome  路  4Comments

aferriss picture aferriss  路  5Comments

willingc picture willingc  路  5Comments