function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Apar Jaggi 6Apar Jaggi 6 

the action.setCallback state is returning an error

loadMoreData:function(component,event,helper){
        event.getSource().set("v.isLoading", true);
        component.set('v.loadMoreStatus', 'Loading....');
        var totalNumberofRows=component.get('v.totalNumberOfRows');
        var currentData=component.get("v.data");
        var counts = component.get("v.currentCount");
        var recordLimit=component.get("v.initialRows");
 if(component.get('v.data').length>=component.get('v.totalNumberOfRows')){
           // console.log("inside if");
                 component.set('v.enableInfiniteLoading', false);
                 component.set('v.loadMoreStatus', 'No more data to load');
        }else{
            var action=component.get("c.fetchRecordData");
            action.setParams({
               limitCount: recordLimit,
                offSetCount: counts
                
            });
            action.setCallback(this,function(response){
                var state=response.getState();
                console.log(state);
                
                if(state === "SUCCESS"){
                    var newData=response.getReturnValue();
                    console.log(newData);
                  /*  component.set("v.data",newData);
                    component.set("v.currentCount",(counts+recordLimit));*/
                }
            });
            $A.enqueueAction(action);
        }
    }
SwethaSwetha (Salesforce Developers) 
HI Apar,
What is the error you are seeing?