I am trying to show a lightning spinner on search and disable it after the search has loaded. The method that calls the search is in a different file than the related html to show the spinner, which is the same file that handles the loaded results. I have tried importing the method into the file that handles the search, but this has only produced errors.
Here is the code for the file with the associated html
@track showSpinner = false;
handleResult(event){
console.log("Loaded");
this.showSpinner = false;
});
}
enableSpinner() {
this.showSpinner = true;
}
and here is the code for the file that handles the initial search:
export default (Base) => class LwcSearchParamMixin extends Base {
@wire(MessageContext)
messageContext;
params = {};
editParam(key, value){
console.log("Searching");
this.params[key] = value;
publish(this.messageContext, searchParamUpdated, {
id:key, value
})
}
}