Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
120 views

I am polling a server, using setInterval, until the pdf's that I want to download are ready...Once the pdfs are ready to download, I clear the interval, and then I call a function async function ...
Chris's user avatar
  • 3,181
1 vote
1 answer
46 views

var [testVar,setTestVar]=useState(0) var showTestVar=()=>{ console.log(testVar) } var effectTest=()=>{ setTestVar(1) setInterval(showTestVar,1000) } I want to have a ...
Gene Knight's user avatar
3 votes
1 answer
59 views

In a video I saw creating a progress bar and updated its value using state and wrapped it inside setInterval for updating it every 15 millisecond and the whole being wrapped inside useEffect, with no ...
ABISHEK NS's user avatar
1 vote
1 answer
40 views

I couldn't really understand what is causing change detection to run in the below code. I understand that markForCheck doesn't do it but something must do it because the view is updated if you play it ...
Luke's user avatar
  • 11
1 vote
0 answers
69 views

This is really a head scratcher... I'm running Node 22.9.0 on a raspberry PI (Linux raspberrypi 6.1.21-v8+) My script, which is run as root, can write a new file in the current directory and update ...
Roy Kolak's user avatar
  • 635
5 votes
4 answers
162 views

I have a useTypewriter hook that seems to skip the second iteration since the i never logs as 1. Why is the code not working? The output should be howdy, not hwdy. Here is the full code: const { ...
user8758206's user avatar
  • 2,245
2 votes
0 answers
38 views

I'm trying to scroll text up the screen in about 4min +/- a few seconds doesn't even matter, along with a 4min audio. To follow it, I've muted the audio 1 second every 10 seconds. I display the ...
user3055937's user avatar
2 votes
3 answers
57 views

Consider this code: const [seconds, setSeconds] = useState<number>(START_VALUE); useEffect(() => { const intervalId = setInterval(() => { setSeconds((previousSeconds) => ...
mehran's user avatar
  • 1,494
0 votes
1 answer
64 views

I'm trying to delay the execution of the setInterval function, which is set at 2000. Ideally, I would like the function to be executed after 10000 at every refresh of the page + after each hide on ...
soph.a's user avatar
  • 25
0 votes
1 answer
46 views

I have a 4 second SVGator animation that needs to run in it's entirety, then have the last 2 seconds loop indefinitely. I've exported as SVG/Javascript, then used the following JS code... const ...
clayRay's user avatar
  • 793
2 votes
1 answer
122 views

I am having a hard time with wait loops in JavaScript to wait for content from an external source (tasker). In particular I have an HTML document with JavaScript (shown in a WebView element inside a ...
Philipp Mayer's user avatar
0 votes
0 answers
31 views

The setInterval() web API does not work when the browser tab is inactive. Is there any alternative for it that can keep the timer intact even when the browser tab/ window is inactive?
Abhinandan Khilari's user avatar
0 votes
1 answer
43 views

I am stuck at the moment. I created the funcitonanilty to control how often data is is fetched using calculation of milliseconds to seconds,munutes and hours, which seems to be working fine. The issue ...
MrJnrDev's user avatar
2 votes
1 answer
45 views

Currently I have a piece of code that changes the background colour of a class every 24 hours. However if a user refreshes the page, the 24 hour cycle starts from the beginning – so they would only ...
Soe123's user avatar
  • 23
0 votes
1 answer
57 views

I modified a javascript code using setInterval to alternate between two messages using innerHTML. I tried document.write and it works. But innerHTML does not work. // Create global interval and ...
anonymous's user avatar
-2 votes
2 answers
41 views

I'm facing issue in updating the setStartTime inside setInterval function. I want to update the startTime every minute. To update that, I've created a useRef and storing the value in timeRef.current. ...
Amrit Anand's user avatar
0 votes
0 answers
193 views

I'm trying to set up a setInterval in a useEffect for an async function that fetches from a URI. I'm using React Router DOM to set up a few pages for the app. The problem I'm facing is that a memory ...
josephwj's user avatar
0 votes
3 answers
170 views

I have a JavaScript function of chrome extension that I need to run at exact 5-minute intervals, synchronized with the current time. For example, it should run at 5:00, 5:05, 5:10, and so on, ...
Hamed's user avatar
  • 41
1 vote
0 answers
208 views

I want to display websocket.readyState in component reactively. But it doesn't change the display status in a timely manner. It always change display at next time. The code can't work properly: let ws ...
zhouying wu's user avatar
0 votes
0 answers
50 views

let scramble = document.getElementById('scramble'); let timer = document.getElementById('timer'); const possibleMoves = ["R", "R'", "R2", "L", "L'", &...
Gabriel Szapałowski's user avatar
0 votes
0 answers
63 views

I've got this React app which sends a 'Post' request. The problem is that: i'm using useEffect(() to automate the sending process of my messages and the application is not capturing the "...
César Espíndola's user avatar
0 votes
2 answers
69 views

I have this code with css animation: @keyframes progress-bar { 0% { width: 0; } 50% { width: 100%; } 100% { width: 0; } } .box { position: relative; height: 3px; ...
yanballas's user avatar
  • 109
0 votes
2 answers
71 views

I have a short code that runs a setInterval only when the element is in view, but for some reason it won't cancel when the element gets out of view. I don't know if I misunderstood InteractionObserver ...
yomisimie's user avatar
  • 393
0 votes
1 answer
64 views

I'm building a website that draws a string into a canvas one character at a time, I've managed to code this first part, but what I'm now trying to do is making the text generate on the center and ...
user avatar
1 vote
3 answers
77 views

Even after adding if else statment inside setInterval() function to clear the interval once my time variable reaches 0, the setInterval() is still running with negative time value. Please specify what ...
KABIR CHANDRIKAPURE's user avatar

1
2 3 4 5
96