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

Difference Between Run Sequence Promises By Creating A New Promise Then Run And Creating All Promises Then Run Each

Please help me explain why log result is different in 2 ways: Way 1: Log sequentially every 1 secon… Read more Difference Between Run Sequence Promises By Creating A New Promise Then Run And Creating All Promises Then Run Each

Promise.all([]) Returns A Resolved Promise, But Promise.race([]) Returns A Pending Promise. Why Are They Different?

If either Promise.all or Promise.race are called with a non-empty array, they return a pending prom… Read more Promise.all([]) Returns A Resolved Promise, But Promise.race([]) Returns A Pending Promise. Why Are They Different?

Javascript Then Without Promise Return Val

Perhaps i'm not googleing correctly. does a then function without a paramater not block? for in… Read more Javascript Then Without Promise Return Val

How Do I Know Which Handlers Throw Error In Promise?

Suppose I have a promise as following: p.then(Task1) .then(Task2) .then(Task3) .catch(errorHandl… Read more How Do I Know Which Handlers Throw Error In Promise?

Aureliajs Waiting For Data On App Constructor

I am developing an app in aureliajs. The development process is started for many months and now, th… Read more Aureliajs Waiting For Data On App Constructor

React - Controlling Ajax Calls Made To The Server

In my React application I have an array of parameters (some IDs, for example), which should be used… Read more React - Controlling Ajax Calls Made To The Server

Issues With Parse Cloud Code Promises

I am trying to work with Parse Cloud Code and use promises to make sure I eliminate any issues with… Read more Issues With Parse Cloud Code Promises

Importing / Exporting Only After Certain Promises Have Resolved

Let's say I have a file containing certain promises, that when executed in order, prepares an i… Read more Importing / Exporting Only After Certain Promises Have Resolved

How To Pass Promise Result Into Outer Function?

function readData(field) { var profileDatabase = firebase.database(); var user = firebase.a… Read more How To Pass Promise Result Into Outer Function?

Mongoose Multiple Synchronous Find To Reuse Object Id

My models has lot of relationship between each object and when I want to search some data I have to… Read more Mongoose Multiple Synchronous Find To Reuse Object Id

Ajax Call In For Loop Wait Until All Done (error Or Success)

I am making AJAX calls in a for loop and I would like to wait until all of them are done before doi… Read more Ajax Call In For Loop Wait Until All Done (error Or Success)

Bluebird Promise Resolve(data) Is Undefined In Client Code

Hiyas. I have a simple app whereby a client is expecting a promise as a result, but upon calling th… Read more Bluebird Promise Resolve(data) Is Undefined In Client Code

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

Infinite Loop When Trying To Make Angularjs Display A Promise

I'm facing an infinite loop when trying to make AngularJS display a promise, as explained in th… Read more Infinite Loop When Trying To Make Angularjs Display A Promise

Promise.all Find Which Promise Rejected

In my code, I am using Promise.all() to run code asynchronously once some promises have all fulfill… Read more Promise.all Find Which Promise Rejected

How To Get The Return Value Of A Javascript Promise?

I am struggling to understand how to get the value of a promise within Javascript to be able to che… Read more How To Get The Return Value Of A Javascript Promise?

Why I Can Not Push Value To Array Outside Of Function?

I have a function: static async assign( assigned_data, assigned_by ) { return new Promise( asyn… Read more Why I Can Not Push Value To Array Outside Of Function?

How To Create A Function That Returns An Existing Promise Instead Of New Promise?

JavaScript/Promise experts, I hope you can help me, because I don't understand how I can create… Read more How To Create A Function That Returns An Existing Promise Instead Of New Promise?

Are There Any (negative) Side Effects When I Don't Use The "then" Function Of A Promise?

I have a function which returns a Promise. Now, sometimes it makes sense for the consumer to use th… Read more Are There Any (negative) Side Effects When I Don't Use The "then" Function Of A Promise?

Why Does This Simple Js Promise Return A Promise?

A really simply question. I've boiled it down to the simplest version that illustrates my probl… Read more Why Does This Simple Js Promise Return A Promise?