Skip to content Skip to sidebar Skip to footer
Showing posts with the label Promise

Expected One Assertion To Be Called But Received Zero Assertion Calls

I am trying to test a method using Jest... The method should return Promise.reject() . Here is the … Read more Expected One Assertion To Be Called But Received Zero Assertion Calls

How Can I Chain Together Groups Of Promises?

I am using the Q javascript promises library and am running in a browser, and I want to figure out … Read more How Can I Chain Together Groups Of Promises?

Search Node In A Tree Using Recursive Javascript Promises

I am stuck in Javascript promise based program and not able to figure out how to get it to return t… Read more Search Node In A Tree Using Recursive Javascript Promises

Difference Between Finally() And Then() In Es2018

Before ES2018, I used to nest an extra then at the end of the promise chain whenever I had to perfo… Read more Difference Between Finally() And Then() In Es2018

Combining Deferred Responses

Is it possible, when using jQuery Deferred's $.when to combine the responses into an array? var… Read more Combining Deferred Responses

Fetch Api Using Async/await Return Value Unexpected

Here's the function: const getUserIP = async () => { let response = await fetch('https… Read more Fetch Api Using Async/await Return Value Unexpected

Can The Return Of A Promise Be Used As An Input For The Next Function Call In A Promise.all() Execution?

I've been looked on StackOverflow and haven't seen any direct examples of what I'm aski… Read more Can The Return Of A Promise Be Used As An Input For The Next Function Call In A Promise.all() Execution?

Javascript - How Do I Reduce Multiple Promise.all?

I am trying to use a Promise.all inside of a reduce and cannot get my function to work, unless ther… Read more Javascript - How Do I Reduce Multiple Promise.all?

Delay Batch Get Requests To Server, Javascript

Background I am making a batch of HTTP GET requests to a server and I need to throttle them to avoi… Read more Delay Batch Get Requests To Server, Javascript

How Do I Send A Form With A Request Promise?

I am trying to use the request-promise library or anything similar to send files via a post request… Read more How Do I Send A Form With A Request Promise?

Promise Not Waiting To Finish

I looked at many examples today. They seem to suggest that the following code should be executed in… Read more Promise Not Waiting To Finish

How To Handle Recursive Asynchronous Db Calls That Modify The Same Variable

Building a JS app with Ionic framework and Firebase. I want the app to suggest to each user a list … Read more How To Handle Recursive Asynchronous Db Calls That Modify The Same Variable

Trying To Understand Scope On Angular 5 .then

On this example, the promise that i created works ok. But the promise from the google api don't… Read more Trying To Understand Scope On Angular 5 .then

How To Wrap Object In A Promise?

I have a code that searches for some data in memory storage and if not found searches that data on … Read more How To Wrap Object In A Promise?

Waiting For All Promises Called In A Loop To Finish

I'm using the axios promise library, but my question applies more generally I think. Right now… Read more Waiting For All Promises Called In A Loop To Finish

Promise Continues After Error

I have some async code that needs to stop in case of error but keeps executing: async saveCoupons({… Read more Promise Continues After Error

Should I Throw An Error Or Return A Rejected Promise Inside An Async Function?

I'm working with the promises provided by the AWS JS SDK. The gist of what I'm doing when I… Read more Should I Throw An Error Or Return A Rejected Promise Inside An Async Function?

In Promises, Is The Callback Order Guaranteed?

I would like to confirm if the call order of callbacks that are passed to then is guaranteed when t… Read more In Promises, Is The Callback Order Guaranteed?

"iterating" Throw Promises Does Not Let To Generate Different Ids

Reading some amazing tutorials about promises, I've discovered that, if I need to interate thro… Read more "iterating" Throw Promises Does Not Let To Generate Different Ids

Spreading Promises In Protractor

q library has this neat feature to resolve and spread multiple promises into separate arguments: I… Read more Spreading Promises In Protractor