@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
39 lines (38 loc) • 2.18 kB
JavaScript
/**
* CodeAnalizerComment: Updated 2 imports on 2024-09-22 14:49:52
* Update:: import { IFPSItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
* Update:: import { IStateSource } to '@mikezimm/fps-core-v7/lib/components/molecules/state-source/IStateSource;'
*/
import { getFPSLinkList } from './getFPSLinkList';
import { startPerformOp, updatePerformanceEnd } from '@mikezimm/fps-core-v7/lib/components/molecules/Performance/functions';
import { DisplayMode } from '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/displayMode';
import { check4This, Check4 } from '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch';
export async function getMultiLinkListsV2(lists, FPSItem, _performance, bannerProps) {
const { ops, } = _performance;
const displayMode = DisplayMode.Edit;
ops.fetch = startPerformOp('fetch Sync', displayMode);
_performance.ops.fetch = startPerformOp('fetch totalGet', displayMode, true);
// export type IDefSourceType = 'lists' | 'tileItems' | 'pages' | 'subs' | 'hubs' | '*';
if (check4This(Check4.sourceResults_Eq_true))
console.log('before', window['FPSEnviro']);
// NOTE: The vars in the array must be in same order they are called in the Promise.all
const allReturns = await Promise.all(lists.map((list, idx) => { return getFPSLinkList(list, FPSItem, idx, bannerProps); }));
// https://github.com/fps-solutions/LinkUp/issues/13
lists.map((list, idx) => {
if (allReturns[idx] && allReturns[idx].unifiedPerformanceOps) {
_performance.ops[`fetch${idx}`] = allReturns[idx].unifiedPerformanceOps.fetch;
}
});
if (check4This(Check4.sourceResults_Eq_true))
console.log('after', window['FPSEnviro']);
const totalLength = 999;
_performance.ops.fetch = updatePerformanceEnd(_performance.ops.fetch, true, totalLength);
const AllItems = {
allReturns: allReturns,
performance: _performance,
};
if (check4This(Check4.sourceResults_Eq_true))
console.log('getMultiLinkListsV2', lists, AllItems);
return AllItems;
}
//# sourceMappingURL=getFPSLinkListMultiple.js.map