If there are multiple ajax calls that call the show(), then if any one of the ajax call is done and calls hide after the response, the loader is hidden but an ajax call is still not done.
It could be like
`
`
In every ajax call I can do this.loadCount++, and when it's done, I can do this.loadCount-- so when all the calls are done loadCount will be 0 and loader will be hidden only when all are done.
If there are multiple ajax calls that call the show(), then if any one of the ajax call is done and calls hide after the response, the loader is hidden but an ajax call is still not done.
It could be like `
`
In every ajax call I can do
this.loadCount++
, and when it's done, I can dothis.loadCount--
so when all the calls are done loadCount will be 0 and loader will be hidden only when all are done.