diia-open-source / be-user-service

European Union Public License 1.2
136 stars 6 forks source link

Backend: bad asynchronous code style, nested blocks #88

Open tshemsedinov opened 3 months ago

tshemsedinov commented 3 months ago

It is much better to move large code blocks out of Promise.all, use intermediate array formed before Promise.all and passed just by reference. We have here multiple async calls inside Promise.all, it is not easy to read

https://github.com/diia-open-source/be-user-service/blob/b45a0e2db354df110a99254516a414aaac43be61/src/services/diiaId.ts#L380-L401