Skip to content
Advertisement

Tag: asynchronous

Calling async function in .map() (React)

I’m trying to iterate over IDs (track.id) and for each of them fetch some data (based on those IDs) from API (getBPM()). I’m pretty sure it’s connected with Promises and I’m not very fluent with these yet. Here’s the code: I’ve tried some things, but couldn’t get it to work. I’d appreciate any kind of help Answer When you call

Angular make subscribe to wait for response

I’m trying to subscribe to an Observable and assign some data from the response, but somehow my code it’s not waiting for the response. Basically the console.log(this.newIds) is runned first and is always empty because the subscribe doesn’t wait for response to come from the backend. How I can force my code to wait for the response to come? Answer

Uncomplete payload | React & Redux Toolkit

I have a big problem,maybe it’s not so big but i dont sleep for almost 24h because of it.I barely finished this Slice,but now,when i submit the data,i get only the automatically set id.. So,to be clear.I have a skill component where i have 2 input forms and a button,i need to retrieve data from both inputs,and then,when they are

Append to array in async for loop

I’ve got this function which contains other nested async functions. I’m unzipping a zipfile and then appending each HTMLImageElement to an array. However, the array is printing like this 16 is the correct number of images I’m expecting, but they’re undefined when I console.log() them. I’m mapping the promise of each image to an array then doing Promise.all() on this

Advertisement