Top "Promise" questions

Promises are a tactic for deferred computing, suitable for several styles of concurrency: thread and event loop concurrency for local computation, and both synchronous and asynchronous remote messaging.

NodeJS Timeout a Promise if failed to complete in time

How can I timeout a promise after certain amount of time? I know Q has a promise timeout, but I'm …

javascript node.js promise settimeout
Chain promises with AngularJS

I have a service called paymentStrategy that get injected in my controller. $scope.buy = function() { paymentStrategy.buy() .then(function(response) { } } …

javascript angularjs promise chaining
Using protractor with loops

Loop index (i) is not what I'm expecting when I use Protractor within a loop. Symptoms: Failed: Index out of …

angularjs selenium-webdriver promise protractor
How to reject a promise from inside then function

This is probably a silly question, but mid promise chain, how do you reject a promise from inside one of …

javascript promise
How can I execute array of promises in sequential order?

I have an array of promises that need to run in sequential order. var promises = [promise1, promise2, ..., promiseN]; Calling RSVP.…

javascript ember.js promise rsvp.js
fromPromise does not exist on type Observable

In Angular 2 using rxjs I was trying to convert a Promise to Observable. As many of online guides showed I …

angular promise rxjs observable es6-promise
How do I handle errors with promises?

As a node programmer. I'm used to use "nodebacks" for handling errors in my code: myFn(param, function(err, data) { …

javascript node.js error-handling promise bluebird
Axios interceptors and asynchronous login

I'm implementing token authentication in my web app. My access token expires every N minutes and than a refresh token …

javascript ajax authentication promise axios
Axios Interceptors retry original request and access original promise

I have an interceptor in place to catch 401 errors if the access token expires. If it expires it tries the …

javascript vue.js promise vuejs2 axios
Angular / TypeScript - Call a function after another one has been completed

I would like to call f2 after f1 has been completed. f1 function can be synchronous or asynchronous. I need …

angular typescript asynchronous promise synchronous