Could be a very basic question. I am wondering how I can call a function from another in LWC.
for eg:
export default class testUtil extends LightningElement {
hangleChange(evt){
this.inputcheck = evt.detail.value;
if(inputval == true){
showtoast(inputval);
}
}
showToast(inpval) {
const event = new ShowToastEvent({
title: 'Get Help',
message: 'Input val changed.'+ inpval,
});
this.dispatchEvent(event);
}
}
I assumed I could use testUtil.showToast(inpval) even that does not work I get undefined function, in case of aura framework I can call functions in the helper method as much as I can, am I missing something or is there no way to build reusable functions in LWC?