Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
pneves3328yIt could seems fast on your network. But in some it doesn't. So it's always cool to have those :p
-
@pneves hoe does the timeout work? Does it wait always 5 seconds even if the request is available after 1 second?
-
pneves3328y
-
rozzzly16718yis yah using requestAnimationFrame? that could do it for yah. Also start the spinner when doing local validation perfor request gets sent.
-
Lol, been there. Spent half an hour on the animation just to have it flash on screen too fast to see it animate. First time I've been sad that my network connection was fast. 😂
-
@morgh you could monitor the duration of the call and if it's less than one second, just set the timeout for the remainder of that second. That way the minimum time they would wait would be 1000ms. If it's a slow connection, they won't wait an additional amount of time, but if it's fast then it would be a smoother transition than something flashing on the screen and them not even realizing what it is.
-
@morgh let us know how it goes. Didn't know requestAnimationFrame was a thing. Looks useful.
-
@mostlyharmless - my thinking is that a smooth transition is a better UX than a jittery UI. No user will complain about a 1 second delay that includes a loading indicator, but they might complain about something flashing in front of them when they can't tell what it is.
-
riekena24907yYou probably already know this, but this rant is on the DevRant homepage (web view)!
Related Rants
Made a really cool spinning animation on a button that submits a form...
API Call is too fast to see it
setTimeout
undefined
1st world problems