Let's suppose I had the following method:
this.loadCustomers = function(){
Request.get("php/loadCustomersAction.php", (function(error, data){
if(!error)
this.setCustomers(data);
}).bind(this));
};
where "Request.get" is a method that performs asynchronous calls.
You can imagine that the "this" in
this.setCustomers()
can keep the same scope as
this.loadCustomers()
without the help of bind when establishing the callback and without making the function synchronous? If so, how could it be done?