Skip to content

Serverless Pro Tips II

Amo Moloko edited this page Jun 23, 2019 · 1 revision

We need to make sure you perform concurrent calls for promises:

async fucntion getRacesAndTeam(teamId) {
const races = await raceModel.fetchAll()
const team = await teamModel.fetch(teamId)
return {
  team.
  fixtures: fixtures.filter(x = > x.teamId === teamId)
 }
}

We can improve these two functions

continue here:https://serverless.com/blog/common-node8-mistakes-in-lambda/

Clone this wiki locally