You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
author Simon Tretter <simllll@users.noreply.github.com> 1557759137 +0200
committer simon <s.tretter@gmail.com> 1557760081 +0200
allows $loading indicator throttling
Problem:
Right now the loading indicator is shown even for very short request. Which results in a "flashing" that looks more like a bug than a feature ;)
Reason & Solution:
when using .set on $loading it shows immediately the loading indicator. (see nuxt-loading.vue) The indicator itself has a throttle property though (which is only checked on .start()). As long as we only have one request, there is no additional benefit of using .set directly, therefore we can rely on the throttle parameter by using start() instead.
Different approach:
Another approach would be implementing our own "throttle" method which sets a timer on "onRequest" when it's not set) or currentRequests === 0), and removes the timer again onResponse when currentRequests <= 0.
But then we need another config option for the throttling param, or can we access the one from nuxt.config's loading property somehow?
Regards
Simon
0 commit comments