I currently have a few functions that return promises such as the below:
function action_one(){
return new Promise((resolve, reject)->{
...
});
}
I want to be able to wait on one before doing the next promise without nesting them. I had searched for some solutions, one being PromiseAll() but it does not seem to do it in order. Another solution was to do the following:
promise.then(result =>{
action
}.then(result =>{
action
}.then(result =>{
action
}.then(result =>{
action
}.then(result =>{ etc.
which I’m not sure works for my issue but it doesn’t seem compactable.
what would be best practice in this situation?