Trying to figure out how to share JS functions with another component. I have followed the documentation on the LWC here
Here is the functions.js file reusableLWCFunctions.js
const myfunction = (myString) => {
console.log(myString);
return myString;
};
export{
myfunction
};
Here is the LWC that calls the function.
Currently I get the following error: reuseableLWCFunctions.myFunction is not a function
import { myFunction } from 'c/reuseableLWCFunctions';
export default class myLWC extends NavigationMixin(LightningElement) {
constructor(){
super();
myFunction('THIS WAS CALLED FROM IMPORTED FUNCTION');
}
Not sure why it's breaking the component and not firing the console.log statement.
Any help would be great:
Already tried the solution on this post