I am new to es6 and thought of implementing arrow functions in a legacy system.
I have written a generic function to execute every ajax call. Below is the code I am using. It is not getting executed in iOS9.
var Promise = httpCall(apiUrl,requestMap,"json",true);
Promise.success(data => {callback(data);});
Promise.error(data => {console.log("SequenceId:error:"+data.responseText);});
function httpCall(apiUrl, data, dataType, async) {
return $.ajax({
url: apiUrl,
dataType: dataType,
data: data,
async: async
})
}
I have also found that arrow functions are not supported in iOS 9 from the below link. http://kangax.github.io/compat-table/es6/
But I just want to understand if there is any work around to solve this issue.