Here is the situation: I have one JS file (getInfo.js) that contains a function with ajax.
define(["underscore", "jquery", "domReady!"],
function (_, $) {
return function (opUrl, opList, onCallback) {
// IRRELEVANT CODE
self.getFetch = function (optionName) { ...
and multiple other JS files calls this function
var test = new getInfo(opUrl, opList, onCallback);
var getJuice = test.getfetch("DataStorage);
Is there a way to make these functions call from different JS file Asynchronous? Or how can I make the getInfo.js script to wait for all the call to be done before fetching from ajax
Thanks!