Skip to content

Tag: es6-promise

Javascript Array of Functions get auto executed

I need to make a sequence of Promises that are executed in a queue. They are dynamic so I need to put them in an array (I have found an article that explains how to). The problem is that my array of functions autoexecuted it self (version with a normal funciton): I don’t know why, an array of functions …

Filtering an array returned from Promise

I am porting the following code: Current version should use SerialPort.list(), which returns a promise. So far, I tried something along these lines, without success: Obviously I am not quite getting what I should do. So the question is: how should I represent the same intent of former FindDevices function, us…

Two promises with a single then for either one of them

I have a function that takes an input, according to that input it will either call one of two functions (both return a promise) I want then to call the same .then() after whatever of them happened. I found Promise.any() but that doesn’t quite do what I want. For curious minds : I am working on a react-n…