core.performMenuCommand({ commandId }) executed only after all other batchPlays

Correct :+1: Also, if you’re returning a promise, it’s not even necessary to add the await keyword - if you think about it, what do you want to wait for in the scope of this function? return is always the last executed line, so there’s nothing after it. Btw, if you add async to your function, everything you return will already be a promise, which can also tidy up the code. I can really recommend typescript + tslint, it makes things so much easier and literally shows you all those little details:

image
Here, the inferred return type is Promise<number> although I just return a number (because of async)

image
Tslint shows that you can remove await in return statements

image


In regards to your example: I’m still not sure what’s the exact order you want the code to run in. Do you want it to be like that:

  1. performMenuCommand (start)
  2. Other finishing actions
  3. Reselect, once performMenuCommand is finished

?