Skip to content

Instantly share code, notes, and snippets.

@choudharymanish8585
Created October 31, 2018 01:49
Show Gist options
  • Save choudharymanish8585/313313ec4ccf2368dd70e3bbe12629a4 to your computer and use it in GitHub Desktop.
Save choudharymanish8585/313313ec4ccf2368dd70e3bbe12629a4 to your computer and use it in GitHub Desktop.
({
/**
* Retrieve the data from server
* */
onInit : function(component, event, helper) {
var action = component.get("c.getRecords");
action.setStorable();
action.setCallback(this,function(response) {
console.log('Response Time: '+((new Date().getTime())-requestInitiatedTime));
var state = response.getState();
if (state === "SUCCESS") {
//set records attribute with unfiltered data
component.set("v.records", response.getReturnValue());
}
});
var requestInitiatedTime = new Date().getTime();
$A.enqueueAction(action);
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment