Skip to main content
Enqueue Action logic updated
Source Link

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(//do your code
   }){;
   
   /* enqueue action in this way that */
   $A.everyMinuteenqueueAction(componentaction);
    window.setTimeout(
   }), 60000);
   });
  $A.getCallback(function() {
   /* enqueue action in this way  */
   $Aconsole.run(functionlog('Calling') {;
       $A     that.enqueueActioneveryMinute(actioncomponent); 
        }), 60000
    );
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           that.everyMinute(component);
       }), 60000);
   });
   
   /* enqueue action in this way  */
   $A.run(function() {
       $A.enqueueAction(action); 
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       //do your code
   });
   
   /* enqueue action in this way  */
   $A.enqueueAction(action);
    window.setTimeout(
        $A.getCallback(function() {
            console.log('Calling');
            that.everyMinute(component);
        }), 60000
    );
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           that.everyMinute(component);
       }), 60000);
   });
   
   /* enqueue action in this way  */
   $A.run(function() {
       $A.enqueueAction(action); 
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           that.everyMinute(component);
       }), 60000);
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           that.everyMinute(component);
       }), 60000);
   });
   
   /* enqueue action in this way  */
   $A.run(function() {
       $A.enqueueAction(action); 
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           thisthat.everyMinute(component);
       }), 60000);
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout(function(){
           this.everyMinute(component);
       }, 60000);
   });
}

You can create a function that you will call in init and in this function you need to add a setTimeout for 1 minute which will call this same function

controller :
doInit: function(component, event, helper){
   helper.everyMinute(component);
}

helper:
everyMinute:  function(component){
   var that = this;
   //put your code here and in setCallback add setTimeout with 1 minute

   var action = componet.get('c.getData');
   action.setCallback(this, function(result){
       setTimeout((function(){
           that.everyMinute(component);
       }), 60000);
   });
}
Source Link
Loading