Fri. Aug 30th, 2019

Host your Website

Read and learn

FatCow Plan for $3.15/mo. only

Javascript Promises: How to use Promise Race. (Promise.race)

1 min read

If you are interested in learning how to use Promise.Race, this is the video for you. Javascript promises allow you to have an asynchronous process report it’s result to a function to be processed but what if you wanted to wait for more than one asynchronous process to finish before you perform a particular action with the results of those asynchronous processes. Well, you need Promise.All. If you watched our previous video, we covered promised.all.

Now what if you are performing more than one task in parallel and you want the results from the first one that returns. You do not care which one returns first and just want the results of the fastest as soon as possible. Well you would do that with Promise.race.

Copyright © All rights reserved. | Newsphere by AF themes.