All Questions
1,190 questions
0
votes
0
answers
32
views
How to handle an error thrown by an asynchronous function? [duplicate]
This is not a duplicate to this question since it discusses rejecting promises. This is about errors that are thrown. It is also worth mentioning that I can't modify the behavior of the mpv....
0
votes
1
answer
180
views
How "for await" loop in Async "queue" could invoke "dequeue" before "enqueue"? It returns new Promise() before it put into queue
I am newbie to Javascript and been reading the David's Flanagan Guide to have general overview.
This code snippet made me confused. I could not realise how the Promise in loop is 'dequeued' before ...
0
votes
1
answer
195
views
(TS 2556) Why am I recieving a type error on a spread argument that has already been explicitly typed and passed as a rest parameter?
function debouncePromise<TParams extends Array<unknown>, TRes>(
fn: (a: TParams) => Promise<TRes>,
time: number,
) {
let timerId: ReturnType<typeof setTimeout> | ...
0
votes
0
answers
57
views
Why does async.queue randomly fail sometimes?
I have written a routine for queueing a set of http requests so that they happen in sequence instead of concurrently. I am using this async library: https://caolan.github.io/async/v3/. This is ...
-1
votes
1
answer
73
views
News.js:16 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'state')
I am getting error of** "News.js:16 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'state')"** when ever i am clicking on next button.
error occur in URL of ...
0
votes
2
answers
85
views
how JS program knows the time in setTimeout inside a function? [duplicate]
const p1 = new Promise((resolve,reject) => {
setTimeout(()=>{
resolve("xxx");
}, 5000)
});
const p2 = new Promise((resolve,reject) => {
setTimeout(()=>{
resolve("xx");
}, ...
1
vote
1
answer
38
views
React Native App only setting to state on second load
I am currently working on the capstone for my course, but I have to use multiple async functions. I need to use AsyncStorage, SQLite storage, and fetching from a REST API. The issue I am encountering ...
0
votes
2
answers
208
views
How to insert a simple delay into javascript
So I want to do some web scraping, using AppleScript to run javascript code on a webpage. I have the following code: (edited to remove proprietary data)
function inputPunch(date_string) {
// ...
0
votes
1
answer
95
views
send a file from a <input> to google drive, but not directly (I need to do some data treatment first using GAS)
I have a huge form with all kind of inputs that I need to do data treatment and then register directly on multiples spreadsheets.
The first part of getting the values and sending it to the ...
0
votes
0
answers
15
views
Sending request with data from other request
I have an User context provider where I want to store functions that validate and refresh his JWT token before every request.
Here is template of my code
const UserContext = createContext({})
const ...
1
vote
2
answers
2k
views
Load Script With Async Functions Before Any Element
I want to verify the user credentials before any page of my site load, so I put an script in the top of each of my HTML document. But this script in particularly has Async functions (because it sends ...
0
votes
0
answers
28
views
async.eachSeries gives error callback is not defined
async.eachSeries([1,2,3], async(item, callback) => {
//await delay(6000);
console.log(item);
callback(null);
}, function(done) {
if(done == null){
}
});
...
1
vote
0
answers
107
views
Append file's content to the new file is not working
I have a folder with 4 files with CSS styles.
Using Node.js modules tried to create a new file 'bundle.css' and append content of these 4 files with style (css).
But the code instead of styles, return:...
0
votes
1
answer
157
views
Node JS Async function not working as expected
I am using NodeJS 18 version, and I am trying to paginate the dynamo DB results using the async function, but it is not giving me any results. My dynamo DB table has the data.
I am using the dynamo db ...
0
votes
1
answer
1k
views
How to sleep component with useEffect
I am trying to implement sorting algorithms and build react app to display how unsorted array is changing with each iteration.
To make it visible, app has to stop for some time after every iteration ...