JS async/await doesn't wait for my functions to resolve their promise
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Can you help me understand why this doesn't work:
I'm working in Aurelia, and I try to validate some input data using the validation controller, which is documented here: https://aurelia.io/docs/plugins/validation#validation-controller
Now, I have a map of this data, where I need to evaluate each entry, and I want to create an array, where each item contains the validation result of each entry, and when everything is done, return the array.
So something like this (simplified):
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach((item) => {
validationResults.push(validateEntry(item));
});
return validationResults;
}
function validateEntry(item){
(aurelia's validation)controller.validate(item, "some value", "some rule")
.then(result => {
return result;
});
}
Now, this will not work of course, because I need to wait for the validation controller to resolve it's promise before I can get any data back, and so far I've failed at that.
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach(async(item) => {
let result = await validateEntry(item);
validationResults.push(result);
});
Now, this doesn't work either, and that's what I'm wondering about. I suppose that my "validateEntry" function is considered finished by the "await" once it's run, and doesn't wait for the "validate()" function's promise inside "validateEntry" to be resolved. Can I write it as simply as this with a few modifications and still get it to work?
javascript async-await es6-promise aurelia-validation
add a comment |
Can you help me understand why this doesn't work:
I'm working in Aurelia, and I try to validate some input data using the validation controller, which is documented here: https://aurelia.io/docs/plugins/validation#validation-controller
Now, I have a map of this data, where I need to evaluate each entry, and I want to create an array, where each item contains the validation result of each entry, and when everything is done, return the array.
So something like this (simplified):
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach((item) => {
validationResults.push(validateEntry(item));
});
return validationResults;
}
function validateEntry(item){
(aurelia's validation)controller.validate(item, "some value", "some rule")
.then(result => {
return result;
});
}
Now, this will not work of course, because I need to wait for the validation controller to resolve it's promise before I can get any data back, and so far I've failed at that.
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach(async(item) => {
let result = await validateEntry(item);
validationResults.push(result);
});
Now, this doesn't work either, and that's what I'm wondering about. I suppose that my "validateEntry" function is considered finished by the "await" once it's run, and doesn't wait for the "validate()" function's promise inside "validateEntry" to be resolved. Can I write it as simply as this with a few modifications and still get it to work?
javascript async-await es6-promise aurelia-validation
You could try usingPromise.all
to get all the results.
– Roshan
Nov 16 '18 at 11:51
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58
add a comment |
Can you help me understand why this doesn't work:
I'm working in Aurelia, and I try to validate some input data using the validation controller, which is documented here: https://aurelia.io/docs/plugins/validation#validation-controller
Now, I have a map of this data, where I need to evaluate each entry, and I want to create an array, where each item contains the validation result of each entry, and when everything is done, return the array.
So something like this (simplified):
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach((item) => {
validationResults.push(validateEntry(item));
});
return validationResults;
}
function validateEntry(item){
(aurelia's validation)controller.validate(item, "some value", "some rule")
.then(result => {
return result;
});
}
Now, this will not work of course, because I need to wait for the validation controller to resolve it's promise before I can get any data back, and so far I've failed at that.
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach(async(item) => {
let result = await validateEntry(item);
validationResults.push(result);
});
Now, this doesn't work either, and that's what I'm wondering about. I suppose that my "validateEntry" function is considered finished by the "await" once it's run, and doesn't wait for the "validate()" function's promise inside "validateEntry" to be resolved. Can I write it as simply as this with a few modifications and still get it to work?
javascript async-await es6-promise aurelia-validation
Can you help me understand why this doesn't work:
I'm working in Aurelia, and I try to validate some input data using the validation controller, which is documented here: https://aurelia.io/docs/plugins/validation#validation-controller
Now, I have a map of this data, where I need to evaluate each entry, and I want to create an array, where each item contains the validation result of each entry, and when everything is done, return the array.
So something like this (simplified):
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach((item) => {
validationResults.push(validateEntry(item));
});
return validationResults;
}
function validateEntry(item){
(aurelia's validation)controller.validate(item, "some value", "some rule")
.then(result => {
return result;
});
}
Now, this will not work of course, because I need to wait for the validation controller to resolve it's promise before I can get any data back, and so far I've failed at that.
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
function ValidateAll(InputDataMap){
let validationResults = new Array();
InputDataMap.forEach(async(item) => {
let result = await validateEntry(item);
validationResults.push(result);
});
Now, this doesn't work either, and that's what I'm wondering about. I suppose that my "validateEntry" function is considered finished by the "await" once it's run, and doesn't wait for the "validate()" function's promise inside "validateEntry" to be resolved. Can I write it as simply as this with a few modifications and still get it to work?
javascript async-await es6-promise aurelia-validation
javascript async-await es6-promise aurelia-validation
asked Nov 16 '18 at 11:47
robertpaulsenrobertpaulsen
12916
12916
You could try usingPromise.all
to get all the results.
– Roshan
Nov 16 '18 at 11:51
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58
add a comment |
You could try usingPromise.all
to get all the results.
– Roshan
Nov 16 '18 at 11:51
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58
You could try using
Promise.all
to get all the results.– Roshan
Nov 16 '18 at 11:51
You could try using
Promise.all
to get all the results.– Roshan
Nov 16 '18 at 11:51
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58
add a comment |
3 Answers
3
active
oldest
votes
You have to return a Promise from your validateEntry
:
function validateEntry(item){
return controller.validate(item, "some value", "some rule")
}
A then
just returning its parameter is not required, and does nothing, so .then(result => { return result; })
can be removed.
The async
callback for the forEach
would not make ValidateAll
to wait for the validation. You have to wait for all Promises to be resolved, and return a Promise from ValidateAll
, the forEach
can be replaced by map
so that you don't need to do the push manually:
let validationResults = new Array();
validationResults = InputDataMap.map(item => validateEntry(item));
You don't need async
here because you do not need an await
here. Now validationResults
contains a list of Promises. You now need to use Promise.all
to wait until those are resolved.
function ValidateAll(InputDataMap){
let validationResults = InputDataMap.map(item => validateEntry(item));
return Promise.all(validationResults);
}
Now ValidateAll
will return a Promise that will resolve with an array containing the results of the validation.
You could shorten the code even more to:
function ValidateAll(InputDataMap){
return Promise.all( InputDataMap.map(validateEntry) );
}
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
add a comment |
You have to return a Promise containing all the async operations, something like this:
function ValidateAll(InputDataMap) {
return Promise.all(InputDataMap.map(item => validateEntry(item)));
}
add a comment |
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
Indeed it does pause the function but async(item) => {//Code}
is another function unaffected by the outer function
async function ValidateAll(InputDataMap){
let validationResults = ;
for (item of InputDataMap) {
let result = await validateEntry(item);
validationResults.push(result);
}
return validationResults;
});
Also notice the async
keyword in front of the function declaration, which mean you have to use it via let results = await ValidateAll(inputData)
or like ValidateAll(inputData).then(results => {//Code})
function ValidateAll(InputDataMap){
return Promise.all(InputDataMap.map(item => validateEntry(item)))
});
1
Areturn await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created byasync
, so you could omit theawait
there. And without aawait
theasync
is not required anymore.
– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337258%2fjs-async-await-doesnt-wait-for-my-functions-to-resolve-their-promise%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to return a Promise from your validateEntry
:
function validateEntry(item){
return controller.validate(item, "some value", "some rule")
}
A then
just returning its parameter is not required, and does nothing, so .then(result => { return result; })
can be removed.
The async
callback for the forEach
would not make ValidateAll
to wait for the validation. You have to wait for all Promises to be resolved, and return a Promise from ValidateAll
, the forEach
can be replaced by map
so that you don't need to do the push manually:
let validationResults = new Array();
validationResults = InputDataMap.map(item => validateEntry(item));
You don't need async
here because you do not need an await
here. Now validationResults
contains a list of Promises. You now need to use Promise.all
to wait until those are resolved.
function ValidateAll(InputDataMap){
let validationResults = InputDataMap.map(item => validateEntry(item));
return Promise.all(validationResults);
}
Now ValidateAll
will return a Promise that will resolve with an array containing the results of the validation.
You could shorten the code even more to:
function ValidateAll(InputDataMap){
return Promise.all( InputDataMap.map(validateEntry) );
}
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
add a comment |
You have to return a Promise from your validateEntry
:
function validateEntry(item){
return controller.validate(item, "some value", "some rule")
}
A then
just returning its parameter is not required, and does nothing, so .then(result => { return result; })
can be removed.
The async
callback for the forEach
would not make ValidateAll
to wait for the validation. You have to wait for all Promises to be resolved, and return a Promise from ValidateAll
, the forEach
can be replaced by map
so that you don't need to do the push manually:
let validationResults = new Array();
validationResults = InputDataMap.map(item => validateEntry(item));
You don't need async
here because you do not need an await
here. Now validationResults
contains a list of Promises. You now need to use Promise.all
to wait until those are resolved.
function ValidateAll(InputDataMap){
let validationResults = InputDataMap.map(item => validateEntry(item));
return Promise.all(validationResults);
}
Now ValidateAll
will return a Promise that will resolve with an array containing the results of the validation.
You could shorten the code even more to:
function ValidateAll(InputDataMap){
return Promise.all( InputDataMap.map(validateEntry) );
}
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
add a comment |
You have to return a Promise from your validateEntry
:
function validateEntry(item){
return controller.validate(item, "some value", "some rule")
}
A then
just returning its parameter is not required, and does nothing, so .then(result => { return result; })
can be removed.
The async
callback for the forEach
would not make ValidateAll
to wait for the validation. You have to wait for all Promises to be resolved, and return a Promise from ValidateAll
, the forEach
can be replaced by map
so that you don't need to do the push manually:
let validationResults = new Array();
validationResults = InputDataMap.map(item => validateEntry(item));
You don't need async
here because you do not need an await
here. Now validationResults
contains a list of Promises. You now need to use Promise.all
to wait until those are resolved.
function ValidateAll(InputDataMap){
let validationResults = InputDataMap.map(item => validateEntry(item));
return Promise.all(validationResults);
}
Now ValidateAll
will return a Promise that will resolve with an array containing the results of the validation.
You could shorten the code even more to:
function ValidateAll(InputDataMap){
return Promise.all( InputDataMap.map(validateEntry) );
}
You have to return a Promise from your validateEntry
:
function validateEntry(item){
return controller.validate(item, "some value", "some rule")
}
A then
just returning its parameter is not required, and does nothing, so .then(result => { return result; })
can be removed.
The async
callback for the forEach
would not make ValidateAll
to wait for the validation. You have to wait for all Promises to be resolved, and return a Promise from ValidateAll
, the forEach
can be replaced by map
so that you don't need to do the push manually:
let validationResults = new Array();
validationResults = InputDataMap.map(item => validateEntry(item));
You don't need async
here because you do not need an await
here. Now validationResults
contains a list of Promises. You now need to use Promise.all
to wait until those are resolved.
function ValidateAll(InputDataMap){
let validationResults = InputDataMap.map(item => validateEntry(item));
return Promise.all(validationResults);
}
Now ValidateAll
will return a Promise that will resolve with an array containing the results of the validation.
You could shorten the code even more to:
function ValidateAll(InputDataMap){
return Promise.all( InputDataMap.map(validateEntry) );
}
edited Nov 19 '18 at 8:18
answered Nov 16 '18 at 11:59
t.nieset.niese
22.7k64066
22.7k64066
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
add a comment |
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
Ah, this made everything clearer, and helped me fix my code, thanks!
– robertpaulsen
Nov 19 '18 at 7:46
add a comment |
You have to return a Promise containing all the async operations, something like this:
function ValidateAll(InputDataMap) {
return Promise.all(InputDataMap.map(item => validateEntry(item)));
}
add a comment |
You have to return a Promise containing all the async operations, something like this:
function ValidateAll(InputDataMap) {
return Promise.all(InputDataMap.map(item => validateEntry(item)));
}
add a comment |
You have to return a Promise containing all the async operations, something like this:
function ValidateAll(InputDataMap) {
return Promise.all(InputDataMap.map(item => validateEntry(item)));
}
You have to return a Promise containing all the async operations, something like this:
function ValidateAll(InputDataMap) {
return Promise.all(InputDataMap.map(item => validateEntry(item)));
}
answered Nov 16 '18 at 12:01
Denis FrezzatoDenis Frezzato
43029
43029
add a comment |
add a comment |
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
Indeed it does pause the function but async(item) => {//Code}
is another function unaffected by the outer function
async function ValidateAll(InputDataMap){
let validationResults = ;
for (item of InputDataMap) {
let result = await validateEntry(item);
validationResults.push(result);
}
return validationResults;
});
Also notice the async
keyword in front of the function declaration, which mean you have to use it via let results = await ValidateAll(inputData)
or like ValidateAll(inputData).then(results => {//Code})
function ValidateAll(InputDataMap){
return Promise.all(InputDataMap.map(item => validateEntry(item)))
});
1
Areturn await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created byasync
, so you could omit theawait
there. And without aawait
theasync
is not required anymore.
– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
add a comment |
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
Indeed it does pause the function but async(item) => {//Code}
is another function unaffected by the outer function
async function ValidateAll(InputDataMap){
let validationResults = ;
for (item of InputDataMap) {
let result = await validateEntry(item);
validationResults.push(result);
}
return validationResults;
});
Also notice the async
keyword in front of the function declaration, which mean you have to use it via let results = await ValidateAll(inputData)
or like ValidateAll(inputData).then(results => {//Code})
function ValidateAll(InputDataMap){
return Promise.all(InputDataMap.map(item => validateEntry(item)))
});
1
Areturn await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created byasync
, so you could omit theawait
there. And without aawait
theasync
is not required anymore.
– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
add a comment |
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
Indeed it does pause the function but async(item) => {//Code}
is another function unaffected by the outer function
async function ValidateAll(InputDataMap){
let validationResults = ;
for (item of InputDataMap) {
let result = await validateEntry(item);
validationResults.push(result);
}
return validationResults;
});
Also notice the async
keyword in front of the function declaration, which mean you have to use it via let results = await ValidateAll(inputData)
or like ValidateAll(inputData).then(results => {//Code})
function ValidateAll(InputDataMap){
return Promise.all(InputDataMap.map(item => validateEntry(item)))
});
I read that if you use the async/await keyword it will pause a function until the promise has been resolved, so I made changes, something like this:
Indeed it does pause the function but async(item) => {//Code}
is another function unaffected by the outer function
async function ValidateAll(InputDataMap){
let validationResults = ;
for (item of InputDataMap) {
let result = await validateEntry(item);
validationResults.push(result);
}
return validationResults;
});
Also notice the async
keyword in front of the function declaration, which mean you have to use it via let results = await ValidateAll(inputData)
or like ValidateAll(inputData).then(results => {//Code})
function ValidateAll(InputDataMap){
return Promise.all(InputDataMap.map(item => validateEntry(item)))
});
edited Nov 16 '18 at 12:13
answered Nov 16 '18 at 11:58
wiomocwiomoc
487512
487512
1
Areturn await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created byasync
, so you could omit theawait
there. And without aawait
theasync
is not required anymore.
– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
add a comment |
1
Areturn await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created byasync
, so you could omit theawait
there. And without aawait
theasync
is not required anymore.
– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
1
1
A
return await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created by async
, so you could omit the await
there. And without a await
the async
is not required anymore.– t.niese
Nov 16 '18 at 12:09
A
return await
does not make much sense, it will wait for the resolve of the Promise just to pass the result to a new Promise that is implicitly created by async
, so you could omit the await
there. And without a await
the async
is not required anymore.– t.niese
Nov 16 '18 at 12:09
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
Yes you are completely right, I fixed it
– wiomoc
Nov 16 '18 at 12:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337258%2fjs-async-await-doesnt-wait-for-my-functions-to-resolve-their-promise%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You could try using
Promise.all
to get all the results.– Roshan
Nov 16 '18 at 11:51
Yes, I tried something like this, based on an example I saw: let validate = InputDataArray.map((value) => { return validateEntry(value); }); let validationResultObjects = Promise.all(validate); validationResultObjects.then(()=> { console.log="done"; }); But even after the Promise.all finished (running "then"), it had not resolved the promise within validateEntry. So I got no further,,
– robertpaulsen
Nov 16 '18 at 11:58