Questions tagged [promises]
A promise is essentially an API that returns a future value, or a way to manage callback functions. More technically, a promise is a programming pattern that helps invoking a mechanism that is going to be asynchronous in nature.
26 questions
-2 votes
1 answer
119 views
Creating a promise based API, from a message based API
I'm building some software that behind the scenes needs to communicate with hardware via a "message" API, over a named pipe. For example, I can send this message: <?xml version="1.0&...
7 votes
2 answers
4k views
How do JavaScript engines convert async/await to promises under the hood?
I'm curious how the async/await syntax is converted to Promises. Maybe I'm just not thinking about it properly, but I don't know how this code would be converted to a Promise: async function myFunc(...
-1 votes
1 answer
150 views
Does avoiding Promises and Async leads to clean code?
While applying for a job interview I found this line in requirements. Experience with clean code writing practices like avoiding callback hell like promises, async Does this line make any sense ? ...
-1 votes
3 answers
336 views
Writing elegant promises in Node.js
I am having a real difficult time writing some clean code with a simple user registration/login manager. I am trying to stay out of nesting/callback hell, and am also not seeing any benefit in using ...
3 votes
1 answer
459 views
What is the advantage of flattening dependent Promises
I've read that nesting Promise continuations is bad practice. For example, here. GetCustomer().then(customer => { ProcessCustomer(customer).then(processingResult => { console....
1 vote
1 answer
1k views
Angular2: Service architecture + error handling
I need support for Angular2 service architectures. I am quite familiar with Angular2 but I don't see the best way to implement services, error handling and their connection with the components. I'm ...
1 vote
2 answers
3k views
How to check for dangling Promises? (Bluebird.js)
I ran into an issue where I forgot to resolve my promise, leaving the remainder of the chain waiting (Forever). Thankfully in my case I was able to track down the issue in only 10 or so minutes, but ...
5 votes
2 answers
399 views
Is a promise-aware eventing system desirable?
I'm fully aware that Promises and eventing are both ways to do asynchronous programming, and you can choose either one for a given project. However, in practice, the code base I'm working with is ...