autoRefresh: function(component){
var that = this;
var action = componet.get('c.getData');
action.setCallback(this, function(result){
//add your code
});
/* enqueue action in this way */
$A.enqueueAction(action);
window.setTimeout(
$A.getCallback(function() {
console.log('Calling');
that.autoRefresh(component);
}), 5000
);
}
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Greetings to you!
I have written a function as per your requirement. You can use this code
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
All Answers
Greetings to you!
You can use setTimeout for 5 seconds which will call the same function.
Controller:
Helper:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
As Khan Anas described you need to write a setTimeout function in your javascript controller to autometically calling after 5 seconds.
Greetings to you!
I have written a function as per your requirement. You can use this code
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.