I'm not sure if I'm understanding this correctly, do I need to create a function like this:
function execute(callback) {
gapi.client.load('drive', 'v2', function() {
callback();
});
}
And then for all my calls call it like this?
function retrieveAllFiles() {
execute(function(){
var request = gapi.client.drive.files.list();
request.execute(function(resp) {
console.log(resp);
}
}
}
function deletefile() {
execute(function(){
...
It works fine but I'm not sure if this is the correct way of doing it?