So I am trying to connect 2 new Promise with each other so I can send information to each other. So I want to use image.url which is made in the first promise b
I have an overlay component that appears when a user clicks on certain things in my page, and in this overlay it gives a warning and 2 buttons, one for yes and
I have this module to fetch data using the Spotify API: const Spotify = { getAccessToken() { ... }, searchTrack(searchTerm) { const accessToken = Spoti
async function async1(){ console.log(1) await async2() console.log(2) } async function async2(){ console.log(3) } console.log(4) setTimeout(funct
I have an array of category ids in order, I have to make a map and fetch the items from these categories and in the end keep the original order of the array wha
I'm having difficulty understanding why I still have pending promises after awaiting Promise.all(). In the example below, I'm creating an array of promises by c
Context and goal I have two fetch/then chains that build elements that I need for an event handler. The first chain loads data to build a <select> element
I have this observable createMyRecord(): Observable<myRecord> { return of(TEMPLATE_DB).pipe( mergeMap((template) => doTask(template
Can anyone help to implement MS SQL transactions in Node.js . I am try to execute multiple stored procedures inside a promise. Method 1 const executeProcedure =
I'm using Jest and Typescript. I have a async function that returns nothing (void). How do I mock returning void? I tried the below const myMockFn = jest.fn(
The editor is showing Type 'Promise' is not assignable to type 'void | Destructor'. for the checkUserLoggedIn() call in useEffect. I can get rid of it by doin
I am trying to understand what would be the best code structure or a design pattern that would do the following: Have a function named get_data that would start
I am using await to make the code cleaner, but I am not sure whether I am handling exceptions correctly. An example while using azure-devops-node-api; const foo
My understanding of how asynchronous tasks are scheduled in JS Please do correct me if I'm wrong about anything: The JS runtime engine agents are driven by an e
I have a list of tasks and all these tasks need to be executed only after all the dependencies are resolved for each task. I am struggling to figure out a way t
I have a map function here, which is supposed to fetch data from an online source. The Problem is, that the API does only allow to fetch once per second. so I t
Really sorry if this has been answered, I've searched everywhere and can't find the exact problem I'm facing. Take this as the example: const fetchData = (email
Up to discord.js v12, my bot would delete messages it posted like this : message.reply("text") .then(msg => { message.delete() msg.delete({timeout:
I have below code in react. useEffect(() => { (async () => { await httpClient .get(`${config.resourceServerUrl}/invent
I am implementing google video person detection . I completely followed their docs and implemented same script they provided But my code is not passing by this