I used the below JS code to download a file. It makes the spinner visible using `loaded=false` but the line `loaded=true` doesn't make the spinner hide.

```
    handleResourceDownload(event) {
        this.loaded = false;
        const index = this.findResourceIndexById(event.target.name);
        const url = this.resources[index].contentDocLink;
        const fileName = this.resources[index].title;
        const mimeType = this.resources[index].mimeType;
        var x = new XMLHttpRequest();
        x.open('GET', url, true);
        x.responseType = 'blob';
        x.onload = function (e) {
            download(x.response, fileName, mimeType);
        };
        x.addEventListener("loadend", function () {
            this.loaded = true;
        });
        x.send();
    }

```

loaded is defined as `@track loaded = false`