Hi I have gone through some answers but none of them seem to work. I have a Javascript file like so. It is stored in my src folder.
let model = function() {
let model = function(data) {
if (!data) return;
return map.call(this, data);
};
function map(data) {
return data;
}
model.map = function(_) {
if (!arguments.length) return map;
map = _;
return model;
};
return model;
};
In one of my components, I am trying to use this file.
import model from '../models/GraphModel';
And then I am trying to use it.
var graph = model();
console.log(graph);
But nothing seems to output and I cant seem to set anything. How can I use this Javascript in my components?
Thanks