rstacruz / nprogress

For slim progress bars like on YouTube, Medium, etc
http://ricostacruz.com/nprogress
MIT License
25.99k stars 1.81k forks source link

Documentation: explain the difference between done() and remove() ? #196

Open thurt opened 6 years ago

thurt commented 6 years ago

Semantically, it's not entirely clear when to use done() vs remove().

For instance, in the case of an ajax error, I wanted to remove the progress indicator immediately so that it doesn't appear to reach completion (the right side of the screen). It seemed to make sense to just call remove() by itself, but I was still seeing the progress indicator. I had to call done() followed by remove() to get the behavior I wanted, which was for the progress indicator to immediately disappear.

Now in the case of a successful ajax completion, I just call done() which causes the progress indicator to reach completion and then disappear.

So I think the readme needs some explanation on using these two methods together.