i have a question about the node js execution of function. Code example
const dynamic = require('dynamic'),
obj1 = dynamic.obj1,
ovj2 = dynamic.obj2;
const myFunction1 = () => {
let x = obj1
};
const myFunction2 = () => {
let x = obj2
};
module.exports.myFunction1 = myFunction1;
module.exports.myFunction2 = myFunction2;
The question is how to design this code to able get updated value from dynamic variable every time when i calling myFunctions. Because require works only once, in the beginning of module. And the dynamic would be static, how to make a solution for it?