Use a Loader with too fast request [duplicate]










0















This question already has an answer here:



  • jQuery - show loading image only if ajax call takes more than one second?

    2 answers



  • show spinner only after 50ms

    1 answer



A quick question, how do you handle requests that are too fast to show correctly a loader ?



I have a submit button which show a loader until firebase respond (ajax request). But firebase is too fast (< 10ms) so my loader is showing very fast and it's not very nice.



Do you have any advices for it ? I would like to avoid setTimeout as possible...



Thanks










share|improve this question













marked as duplicate by mplungjan javascript
Users with the  javascript badge can single-handedly close javascript questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 at 13:43


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
    – JustLearning
    Nov 12 at 13:24











  • Can't avoid using setTimeout if you don't like the current behavior
    – charlietfl
    Nov 12 at 13:24










  • Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
    – mplungjan
    Nov 12 at 13:29










  • Why have a loader if the response is 10ms?
    – mplungjan
    Nov 12 at 13:30











  • Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
    – jacman
    Nov 12 at 13:36















0















This question already has an answer here:



  • jQuery - show loading image only if ajax call takes more than one second?

    2 answers



  • show spinner only after 50ms

    1 answer



A quick question, how do you handle requests that are too fast to show correctly a loader ?



I have a submit button which show a loader until firebase respond (ajax request). But firebase is too fast (< 10ms) so my loader is showing very fast and it's not very nice.



Do you have any advices for it ? I would like to avoid setTimeout as possible...



Thanks










share|improve this question













marked as duplicate by mplungjan javascript
Users with the  javascript badge can single-handedly close javascript questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 at 13:43


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
    – JustLearning
    Nov 12 at 13:24











  • Can't avoid using setTimeout if you don't like the current behavior
    – charlietfl
    Nov 12 at 13:24










  • Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
    – mplungjan
    Nov 12 at 13:29










  • Why have a loader if the response is 10ms?
    – mplungjan
    Nov 12 at 13:30











  • Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
    – jacman
    Nov 12 at 13:36













0












0








0








This question already has an answer here:



  • jQuery - show loading image only if ajax call takes more than one second?

    2 answers



  • show spinner only after 50ms

    1 answer



A quick question, how do you handle requests that are too fast to show correctly a loader ?



I have a submit button which show a loader until firebase respond (ajax request). But firebase is too fast (< 10ms) so my loader is showing very fast and it's not very nice.



Do you have any advices for it ? I would like to avoid setTimeout as possible...



Thanks










share|improve this question














This question already has an answer here:



  • jQuery - show loading image only if ajax call takes more than one second?

    2 answers



  • show spinner only after 50ms

    1 answer



A quick question, how do you handle requests that are too fast to show correctly a loader ?



I have a submit button which show a loader until firebase respond (ajax request). But firebase is too fast (< 10ms) so my loader is showing very fast and it's not very nice.



Do you have any advices for it ? I would like to avoid setTimeout as possible...



Thanks





This question already has an answer here:



  • jQuery - show loading image only if ajax call takes more than one second?

    2 answers



  • show spinner only after 50ms

    1 answer







javascript ajax api request loader






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 13:18









jacman

1668




1668




marked as duplicate by mplungjan javascript
Users with the  javascript badge can single-handedly close javascript questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 at 13:43


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by mplungjan javascript
Users with the  javascript badge can single-handedly close javascript questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 at 13:43


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1




    in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
    – JustLearning
    Nov 12 at 13:24











  • Can't avoid using setTimeout if you don't like the current behavior
    – charlietfl
    Nov 12 at 13:24










  • Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
    – mplungjan
    Nov 12 at 13:29










  • Why have a loader if the response is 10ms?
    – mplungjan
    Nov 12 at 13:30











  • Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
    – jacman
    Nov 12 at 13:36












  • 1




    in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
    – JustLearning
    Nov 12 at 13:24











  • Can't avoid using setTimeout if you don't like the current behavior
    – charlietfl
    Nov 12 at 13:24










  • Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
    – mplungjan
    Nov 12 at 13:29










  • Why have a loader if the response is 10ms?
    – mplungjan
    Nov 12 at 13:30











  • Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
    – jacman
    Nov 12 at 13:36







1




1




in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
– JustLearning
Nov 12 at 13:24





in the backend stop thread execution E.g. Thread.Sleep(1000) for C#.
– JustLearning
Nov 12 at 13:24













Can't avoid using setTimeout if you don't like the current behavior
– charlietfl
Nov 12 at 13:24




Can't avoid using setTimeout if you don't like the current behavior
– charlietfl
Nov 12 at 13:24












Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
– mplungjan
Nov 12 at 13:29




Do some research, search for related topics on SO; if you get stuck, post a Minimal, Complete, and Verifiable example of your attempt, noting input and expected output.
– mplungjan
Nov 12 at 13:29












Why have a loader if the response is 10ms?
– mplungjan
Nov 12 at 13:30





Why have a loader if the response is 10ms?
– mplungjan
Nov 12 at 13:30













Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
– jacman
Nov 12 at 13:36




Sorry, it's not really a problem but i want to know what are the best practices in JS for that purpose. I put a loader because depending of the network it can be longer
– jacman
Nov 12 at 13:36












1 Answer
1






active

oldest

votes


















-1














In this cases the unique way is delete the loader/spinner or set a time out.



I hope my answer are helpful






share|improve this answer




















  • This is not an answer. Please give a few more actual answers to get the rep to comment
    – mplungjan
    Nov 12 at 13:28










  • I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
    – Matias Simone
    Nov 12 at 13:40

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














In this cases the unique way is delete the loader/spinner or set a time out.



I hope my answer are helpful






share|improve this answer




















  • This is not an answer. Please give a few more actual answers to get the rep to comment
    – mplungjan
    Nov 12 at 13:28










  • I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
    – Matias Simone
    Nov 12 at 13:40















-1














In this cases the unique way is delete the loader/spinner or set a time out.



I hope my answer are helpful






share|improve this answer




















  • This is not an answer. Please give a few more actual answers to get the rep to comment
    – mplungjan
    Nov 12 at 13:28










  • I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
    – Matias Simone
    Nov 12 at 13:40













-1












-1








-1






In this cases the unique way is delete the loader/spinner or set a time out.



I hope my answer are helpful






share|improve this answer












In this cases the unique way is delete the loader/spinner or set a time out.



I hope my answer are helpful







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 at 13:26









Matias Simone

154




154











  • This is not an answer. Please give a few more actual answers to get the rep to comment
    – mplungjan
    Nov 12 at 13:28










  • I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
    – Matias Simone
    Nov 12 at 13:40
















  • This is not an answer. Please give a few more actual answers to get the rep to comment
    – mplungjan
    Nov 12 at 13:28










  • I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
    – Matias Simone
    Nov 12 at 13:40















This is not an answer. Please give a few more actual answers to get the rep to comment
– mplungjan
Nov 12 at 13:28




This is not an answer. Please give a few more actual answers to get the rep to comment
– mplungjan
Nov 12 at 13:28












I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
– Matias Simone
Nov 12 at 13:40




I don't think this is a bad answer. Because in these cases you can not use a conditional to show or not the loader and showing it too fast would be a bad user experience @mplungjan
– Matias Simone
Nov 12 at 13:40



Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党