Should I use Promise.all? When should I use it

Hi I am not sure if I should use a promise all in a case like this:
const userMessage = await Message.create()
const messages = await Session.get();
const userMessage = await Message.create()
const messages = await Session.get();
Does it make sense to use it here?
3 Replies
user161803398
user161803398•15mo ago
hate to be that guy but theo does have quite a good video on this: https://www.youtube.com/watch?v=f2Z1v3cqgDI
Theo - t3․gg
YouTube
The Dangers Of Promise.all()
Please just use Promise.allSettled() Keywords JAVASCRIPT JS TS TYPESCRIPT ASYNC SYNC ASYNCHRONOUS SYNCHRONOUS PROMISES ALL MY VIDEOS ARE POSTED EARLY ON PATREON https://www.patreon.com/t3dotgg Everything else (Twitch, Twitter, Discord & my blog): https://t3.gg/links
user161803398
user161803398•15mo ago
and the comments are just as helpful, good luck friend 🫡
utdev
utdevOP•15mo ago
ty, I remember this one and I also remember there being a better function for promise all allSettled that was it
Want results from more Discord servers?
Add your server