JavaScript Promises all Method

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Seen several good programmers try to teach this (coding train, traversy). You beat em all with simple examples that are easy to follow. Thanks.

codegate
Автор

Thank you for the lesson, mr. Griffith

honoredegg
Автор

Very clear and simple explenation, thanks a lot!

ctomasic
Автор

dude you just save me thx a lot, i didn't knew this

alejandrocastroq
Автор

Hi Steve. Thanks for these awesome tutorials. Could you maybe consider doing some exercises for fetch and promise (like using weather API to display weather status of different locations in webpage) and upload them to your channel. It is really hard to find some good resources on youtube for fetch and promises.

Thanks so much for considering my request in advance ;)

ShinjuiroX
Автор

watch your video give me more basic concept knowledge, sometime I just do it even though I dont understand what it is.

tinpham
Автор

Even though all is a better method for this purpose but can we chain these three promises and then call another then method for the final task? I mean would it be valid to do so?

ayushpatel
Автор

If you needed information back from a promise call to use in another promise call. Could you use this?

For example. Querying an api to get a list of teams in a league. The teams do not have names but just an id number. You can use these id numbers to make another query (fetch) to find out the names of these teams.

The idea being that I would want to return both the information of the league as well as the team names all in one go to the user.

Chris-fhqv
Автор

Hi Steve you way of explaining things is great, I have a promise but Im using a flatlist that calls a array for the data to be display,
=> this.setState(
dataSource: data,
}));
when I do it like this it recognize the number of arrays but not the info inside of the array.
Do you know how to make the arrange recognizable for the flatlist?

elbuenrobin
Автор

Won't that defeat the purpose of the .then() call, and the clarity it brings to the code?

kebman
Автор

Do it like a professional with map 🤪
Promise.all([p1(), p2(), p3]).then(( resultsArr => {
return resultsArr.map(x => console.log(x))
}));

kimshares