promise Questions
3
Solved
Consider this simple example, probably a function you wrote a couple of times, but now abortable:
/**
*
* @param {number} delay
* @param {AbortSignal} [abortSignal]
* @returns {Promise<voi...
Bigeye asked 15/7 at 0:40
4
Solved
I don’t understand why this piece of code results in such an order? Could anyone elaborate on this? I thought Promises were like a FIFO queue, but the nested Promise functions seems a little bit un...
Goldofpleasure asked 7/10, 2019 at 13:18
2
Solved
Promise.race(promise1, promise2, ...) returns a promise with the resolve/reject result for the "fastest" promise from the list.
What happens to the other promises, i.e. those that "l...
Undervest asked 19/5, 2021 at 13:26
3
Solved
I have such a function, which create a write stream and then write the string array into the file. I want to make it return a Promise once the writing is finished. But I don't know how I can make t...
Metropolitan asked 5/10, 2016 at 18:2
7
I have a MUIRadioGroup (options = Low, Medium and High) and a multi-select MUIAutocomplete component on my form.
<MUIRadioGroup
name="requestDetail.riskAssesmentDetail.riskClassification&q...
Transformer asked 24/2, 2023 at 7:38
4
Solved
I'm trying to learn what Promise is, so I started following this guide.
I copied this code from the guide and tried it in my developer console:
var promise = new Promise(function(resolve, reject)...
Corinnacorinne asked 2/9, 2019 at 2:46
3
Solved
My question is basically a combination of
What is the best way to limit concurrency?
Wait until all promises complete even if some rejected
I'm aware of Promise.allSettled, but I'm failing to fin...
Cheri asked 20/11, 2020 at 14:52
9
I would like to wait for a map of word to Promise to finish. BlueBird has Promise.props which accomplishes this, but is there a clean way to do this in regular javascript? I think I can make a new ...
Juliennejuliet asked 17/6, 2017 at 4:29
4
I have a total n00b question here on synchronization. I have a 'writer' thread which assigns a different value 'p' to a promise at each iteration. I need 'reader' threads which wait for shared_futu...
Diaconal asked 30/6, 2011 at 21:34
3
I just loaded the boilerplate code from the Tensorflow Toxicity classifier example from this Github page.
Here's the code in index.js -
const toxicity = require('@tensorflow-models/toxicity');
...
Decorate asked 6/5, 2020 at 5:46
3
Solved
I would like to fetch data from multiple locations from
Firebase Realtime Database like described here and here by Frank van Puffelen and I can't find any equivalent to Promise.all in c#. What woul...
Effable asked 2/2, 2019 at 18:0
11
Solved
All four functions are called below in update return promises.
async function update() {
var urls = await getCdnUrls();
var metadata = await fetchMetaData(urls);
var content = await fetchContent...
Route asked 3/6, 2016 at 22:6
4
Solved
I have below code in react.
useEffect(() => {
(async () => {
await httpClient
.get(`${config.resourceServerUrl}/inventory/`)
.then((response) => {
setSponsor(response.data.sponsor);
...
Orthopedic asked 11/2, 2022 at 9:22
4
Solved
As I understand a promise is something that can resolve() or reject() but I was suprised to find out that code in the promise continues to execute after a resolve or reject is called.
I considered...
Naresh asked 6/3, 2015 at 9:55
14
Solved
I use ES6 Promises to manage all of my network data retrieval and there are some situations where I need to force cancel them.
Basically the scenario is such that I have a type-ahead search on the...
Gangrel asked 14/5, 2015 at 9:3
6
Solved
I'm doing some unit testing. The test framework loads a page into an iFrame and then runs assertions against that page. Before each test begins, I create a Promise which sets the iFrame's onload ev...
Mefford asked 7/3, 2015 at 23:4
3
Solved
My idea is as follows:
I want to send multiple requests simultaneously without having to wait until priors execution.
So my pseudo code looks as follows:
function sleep(ms) {
return new Promis...
Exile asked 12/5, 2021 at 11:13
9
Solved
I'm making a function that permits me to upload a picture to imgur in my express API (nodejs),
I'm encountering an error when calling a function returning a promise:
TypeError: res.status is not a...
Directorate asked 3/1, 2020 at 19:31
6
Solved
I've been messing around with the fetch() api recently, and noticed something which was a bit quirky.
let url = "http://jsonplaceholder.typicode.com/posts/6";
let iterator = fetch(url);
iterato...
Burin asked 31/5, 2016 at 20:26
3
Solved
I'm recently exploring TypeScript again. One of it's key limitations seems to be the incapability of typing function composition. Let me first show you the JavaScript code. I'm trying to type this:...
Calla asked 9/2, 2020 at 11:13
4
Solved
When I execute the following code, I thought Node.js will wait till we call the resolve. Till then the myPromise will be in the <pending> state. Then how come node exits before it resolves?
T...
Savitt asked 27/3, 2023 at 15:23
7
Solved
Using ES6 promises, how do I create a promise without defining the logic for resolving it? Here's a basic example (some TypeScript):
var promises = {};
function waitFor(key: string): Promise<an...
Disject asked 26/6, 2015 at 9:20
4
Solved
While all the questions about Promise.all focus on how to wait for all promises, I want to go the other way -- when any of the promises fails, stop the others, or even stop the whole script.
Here'...
Thesis asked 13/2, 2018 at 8:50
3
Solved
I know the problem is usual. I'm using es6 promises, and I have multiple layers.
On runtime, when I don't catch a promise, I have Uncaught (in promise) in my console. But the fact is that I do catc...
Pursy asked 21/6, 2017 at 14:9
4
Solved
I read many articles about R promises (including this) and still don't get it.
See code:
library(future)
library(promises)
plan(multiprocess)
read.csv.async <- function(file, header = TRUE, ...
Invar asked 25/7, 2019 at 0:7
1 Next >
© 2022 - 2024 — McMap. All rights reserved.