klendi / react-top-loading-bar

A very simple, highly customisable youtube-like react loader component.

Home Page:https://klendi.github.io/react-top-loading-bar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with `continuousStart` and async `complete`

pierre-borckmans opened this issue · comments

Hi there, thanks for this nice component!

I'm running into a small issue or I might be overlooking something.

Here is an example of the problem:
https://codesandbox.io/s/long-wind-ud61h

If you click the Fake fetch button, you will see that after the complete method is called asynchronously, the continuous progress continues.

The fake fetch method basically does this:

    this.LoadingBar.continuousStart(0);
    setTimeout(() => this.complete(), 2000);

Am I missing something?

I went ahead and created a PR that might be a quick solution for this: #16

Well this is hella out of a weird bug 😄.

Check my response at #16