MCPcopy Create free account
hub / github.com/apitable/apitable / getComputeRefManager

Function getComputeRefManager

packages/core/src/compute_manager/helper.ts:31–48  ·  view source on GitHub ↗
(state: IReduxState)

Source from the content-addressed store, hash-verified

29 * Pass in the current `state`, and return the reference relationship management instance of the computed field in the current state.
30 */
31export const getComputeRefManager = (state: IReduxState) => {
32 const refMapCache = computeCache.get(COMPUTE_REF_MAP_CACHE_KEY);
33 // The server does not have a mechanism to update the refMap, so every time it gets the latest one. cannot be retrieved from the cache.
34 if (refMapCache && !isServer()) {
35 const computeRefManager = new ComputeRefManager(refMapCache.refMap, refMapCache.reRefMap);
36 return computeRefManager;
37 }
38 const computeRefManager = new ComputeRefManager();
39 Object.keys(state.datasheetMap).forEach(datasheetId => {
40 const currSnapshot = getSnapshot(state, datasheetId);
41 const fieldMap = currSnapshot?.meta.fieldMap;
42 if (fieldMap) {
43
44 computeRefManager.computeRefMap(fieldMap, datasheetId, state);
45 }
46 });
47 return computeRefManager;
48};

Callers 8

hasErrorMethod · 0.90
hasErrorMethod · 0.90
computeEventMethod · 0.90
checkComputeRefFunction · 0.90
WidgetBlockMainBaseFunction · 0.90
getDependenceDstIdsFunction · 0.90
getDependenceByDstIdsFunction · 0.90
getDstNetworkDataFunction · 0.90

Calls 6

computeRefMapMethod · 0.95
isServerFunction · 0.90
getSnapshotFunction · 0.90
getMethod · 0.65
keysMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected