amitmahida92 / ng4-loading-spinner

Angular 4 custom async loading spinner.
MIT License
69 stars 31 forks source link

fixed situation when multiple show/hide method calls overlap #7

Closed diktar closed 6 years ago

diktar commented 7 years ago

Fixes the following situation:

  1. show() is called
  2. show() is called again within threshold of 500ms, timer is overwritten with another instance
  3. hide() is called again within threshold of the same 500ms, so it cancels the function from the second setTimeout(). At this point hide() can be called any number of times, it doesn't matter
  4. The timeout from the first step runs out, function is called and spinner is shown. If one doesn't call hide() after that spinner hangs forever
amitmahida92 commented 6 years ago

Thanks @diktar for your valuable support :+1: .

umashankard commented 6 years ago
  1. I called show(). Its take few seconds to show Spinner.
  2. In my case. I called show() in one component
    • Called show() in Component1. Then called one HTTP service. I got Response before Spinner load. I hide spinner after I get the response only. but spinner loaded after the hide() method only. In that case, it's continuous spinner is showing