The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
63 views

Error handlers inside Promise.all

I'm looking at this piece of code and whilst it works, it feels wrong to me. I'm wondering if I am looking at an anti-pattern? The code starts with two promises, getAccounts and getTransactions. On ...
0
votes
0answers
42 views

iron-ajax chaining polymer

I am looking for a way to nicely chain promises in polymer. Now I define a method in my on-response to send the result of my first request to. Upon response, I fire my second request. This flow makes ...
2
votes
1answer
46 views

How do I achieve non-linear non-dependent control flow using Promises (in server-side ES6)

Coming over from the Java world, I am having trouble translating a multi-threaded approach to IO to the ES6 Promises concept of aysnc IO. Many of the examples I have seen on promises show a linear ...
0
votes
3answers
141 views

Which of these promise methods is considered a best practice?

I have a couple of async method that is basically a yes and no reply isUsernameAvalible() isOnline() isImage() yada yada... you probably get the point by now. As a demonstration... try to think of ...
1
vote
3answers
96 views

Is synchronously inspecting a promise an anti-pattern?

ES6 native promises do not allow you to synchronously check if they're resolved/pending/failed or to extract their value. I sometimes need this functionality and thus I have to code it manually. Is ...
1
vote
1answer
130 views

Is there any value in using a Promises library versus ES6 Promises?

I see a lot of NodeJS articles recommending the Bluebird library for promisifying your code and avoiding callback spaghetti. Is there any value in using such a library when using Node 4.2.4+ given ...
3
votes
1answer
55 views

Should I be returning promises from any function that uses them?

Promises is a fairly new pattern for me, so I'm still building my intuition for them. I recently came across a case where some code in an adapter-like bit of code was once synchronous, and then ...
3
votes
1answer
97 views

Javascript Promise chaining [closed]

I recently started working with JS Promises. What I always like to do, is create function, which returns a Promise with the final desired result, but I only do 1 operation/then. Consider something ...
22
votes
1answer
3k views

Is there really a fundamental difference between callbacks and Promises?

When doing single-threaded asynchronous programming, there are two main techniques that I'm familiar with. The most common one is using callbacks. That means passing to the function that acts ...