Skip to content

Commit

Permalink
Code format changes to unifiedDataLoader.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
the-bay-kay committed Oct 24, 2023
1 parent 1907966 commit 46c1429
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions www/js/unifiedDataLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ export const combinedPromises = function(promiseList: Array<Promise<any>>,
if (firstError && nextError) {
reject([firstError, nextError]);
} else {
logDebug("About to dedup localResult = "+firstResult.length
+"remoteResult = "+nextResult.length);

logDebug(`About to dedup firstResult = ${firstResult.length}` +
` nextResult = ${nextResult.length}`);
const dedupedList = combiner(firstResult, nextResult);
logDebug("Deduped list = "+dedupedList.length);
logDebug(`Deduped list = ${dedupedList.length}`);
resolve(dedupedList);
}
}
Expand Down Expand Up @@ -94,11 +93,11 @@ export const combinedPromises = function(promiseList: Array<Promise<any>>,
export const getUnifiedDataForInterval = function(key: string, tq: TimeQuery,
getMethod: (key: string, tq: TimeQuery, flag: boolean) => Promise<any>) {
const test = true;
const localPromise = getMethod(key, tq, test);
const getPromise = getMethod(key, tq, test);
const remotePromise = getRawEntries([key], tq.startTs, tq.endTs)
.then(function(serverResponse: ServerData) {
return serverResponse.phone_data;
});
var promiseList = [localPromise, remotePromise]
.then(function(serverResponse: ServerData) {
return serverResponse.phone_data;
});
var promiseList = [getPromise, remotePromise]
return combinedPromises(promiseList, combineWithDedup);
};

0 comments on commit 46c1429

Please sign in to comment.