I’m working in Vue (not really relevant) and I’m making a few requests using async. My issue is because I’ve decided to use Promise.all() it returns an array, which I then need to assign to relevant state keys and it looks and smells like an anti-pattern.
Wondering about your thoughts?
Please don’t comment if you are off topic or want to share your stylistic differences ex. where are my semi-colons, etc.
const [ jobData, customers ] = await Promise.all([ this.getJob().catch(err => console.error(err)), this.getCustomers().catch(err => console.error(err)) ]) this.job = jobData // <- is this an anti-pattern. How can I avoid it?