I need to run this @wire on a click event. I thought on creating, inside the LWC class, a method to call it, but it didn't work.
how can I call the WIRE service inside a function with parameter?
something similar to this:
myMethod(PARAMETER){
@wire(getRelatedMedia, { productId: PARAMETER })
relatedMedia({ error, data }) {
if (data) {
// this.contacts = data;
// this.error = undefined;
console.log(data);
} else if (error) {
console.log('erro');
// this.error = error;
// this.contacts = undefined;
}
}
}