Skip to main content

All Questions

-2 votes
1 answer
41 views

Can I avoid awaiting an async function if no return is expected or required [duplicate]

I think I understand async/await but I am confused by a part I have reached in my code in a very common scenario. I have an async function createOrder() that processes orders. Before that function ...
volume one's user avatar
  • 7,583
1 vote
0 answers
42 views

Async context tracking, async_hooks

I'm trying to better understand the output from node async_hooks. It's not giving me the output I expect. Specifically, I'd expect that each new async function creates a new asynchronous context. So ...
libby's user avatar
  • 644
0 votes
2 answers
53 views

Is a syncronous function call inside of async recursive function blocking in Javascript?

Would async bar() wait for sync foo() to finish before awaiting the new promise/timeout and calling bar() again? function foo() { console.log('is bar waiting for me to finish?'); } async function ...
justiceorjustus's user avatar
0 votes
1 answer
127 views

How can I run a function alongside an async one?

I want to kick off an async task but then have another function run that shows some animation. I can't do const myFunc = async () => { // await asyncFunc() // await animateFunc() } as it won't ...
Red Baron's user avatar
  • 7,701
0 votes
1 answer
94 views

The execution order of the promise according to the return type 2

This question is similar to my previous "The execution order of the promise according to the return type", but it is a little different. Why is the order of execution of caseA and caseB ...
Won Jin Kim's user avatar
1 vote
0 answers
61 views

How does JavaScript handle asynchronous recursion in call stacks for deeply nested Promises? [closed]

I'm working on an application where I need to recursively process a deeply nested structure using asynchronous operations (Promised-based API calls), and I'm curious about how JavaScript's event loop, ...
anubhav chaudhary's user avatar
0 votes
0 answers
42 views

Why not "export" the state and result of Promise? [duplicate]

EDIT: ok, I understand the problem with "Zalgo" (having an API that sometimes calls a callback synchronously and sometimes not). I'll remove this from my question and focus on the state and ...
Aayla Secura's user avatar
0 votes
1 answer
54 views

How to save information from an async request and use it in another async request after an event is triggered?

Part of a game I am making requires a query to gpt-4o asking whether two people have met. An inital person is provided and the user has to input the name of someone who they think has met the initial ...
Aug's user avatar
  • 1
0 votes
2 answers
107 views

Promise all is blocking other fetch call

I actually consume some remote API using the FETCH API like below document.addEventListener("DOMContentLoaded", () => { loadCart(); aggregateSearch("france", ["api1&...
akio's user avatar
  • 1,041
1 vote
1 answer
59 views

Handling Asynchronous API Calls with Ordered Results in Vuejs

In my project, I want to implement a feature that calls up to n APIs (where n ≤ 4) to fetch images and then displays them in a list. I use a state called listImages to manage this. Here’s how it ...
Báu Trần Văn's user avatar
1 vote
2 answers
78 views

Why does `promise.finally` execute after its caller's `then`?

Consider this: const a = () => { return new Promise((resolve) => { resolve(1); }); }; const b = () => { return new Promise((resolve) => { a() .then((aR) => { ...
typed-sigterm's user avatar
1 vote
2 answers
144 views

How to wait until all other parallel promises resolve?

I am currently implementing a client-side token refreshing script for a website, and reached a minor problem when the access token needed to be refreshed. For some pages, the client fetched multiple (...
kguzek's user avatar
  • 333
0 votes
2 answers
111 views

What does a top-level async function return in JavaScript? [duplicate]

If I call an async function that doesn’t explicitly return anything from the await, will it return a resolved Promise? Or Void? Something else? For example an IIFE like this, or this but it being ...
Matt Styles's user avatar
0 votes
2 answers
39 views

How to return data in SOAP from Promise

I created a SOAP server in Node.js const soap = require('soap'); const http = require('http'); const XMLWriter = require('xml-writer'); const service = { ImpDispatcherService: { ...
Wernfried Domscheit's user avatar
1 vote
0 answers
45 views

Code executing inside of promise declarations at first instead of waiting for promise race

I have piece of code here where I have used Promises to make use the a timeout function resolves after 1 min if the reload function takes more than 1 min to execute, the problem I am facing is the ...
Sourabh Raja's user avatar

15 30 50 per page
1
2 3 4 5
148