Is there any way to assign value to global variable in salesforce helper javascript?
Helper
({
resetTime: 30000,
refreshNotif: function(component, helper) {
window.setInterval(
$A.getCallback(function() {
console.log('test 1');
}),
helper.resetTime
);
},
updateRead: function(component, helper) {
helper.resetTime = 50000;
}
})
my question is, when page loads the refreshNotif function is getting called and the reset time value should be 30000. but when updateRead function is called how can i assign the value 50000 to resetTime global variable so that helper.resetTime in the refreshNotif function should also get updated to 50000.
is my approach above is correct?
Right now the value is set to 30000 even when the second function getting called