I've imported a function from a module. In that function I need to get a property of the class without sending the class as a parameter to the function, because I cannot send the parameter every time I call the function.
What I've tried, but didn't worked
import {x} from './export.js';
class foo {
constructor() {
x();
}
str = 'A String';
}
export.js
export function() {
console.log(this.str); // Or Maybe Something Else...
}