MCPcopy Create free account
hub / github.com/alephdata/aleph / selectObject

Function selectObject

ui/src/selectors.js:13–32  ·  view source on GitHub ↗
(state, objects, id, mutationKey)

Source from the content-addressed store, hash-verified

11}
12
13function selectObject(state, objects, id, mutationKey) {
14 if (!id || !_.has(objects, id)) {
15 return loadState();
16 }
17 const obj = objects[id];
18 const isLoadable = !obj.isError && !obj.isPending;
19 if (isLoadable) {
20 const globalMutationTimestamp = selectTimestamp(state);
21 const mutationTimestamp = selectTimestamp(state, mutationKey);
22
23 const outdated =
24 obj.loadedAt &&
25 (obj.loadedAt < globalMutationTimestamp ||
26 obj.loadedAt < mutationTimestamp);
27
28 obj.shouldLoad = obj.shouldLoad || outdated;
29 }
30 obj.shouldLoadDeep = obj.shouldLoad || (isLoadable && obj.shallow !== false);
31 return obj;
32}
33
34function selectResult(state, query, expand, mutationKey) {
35 if (!query || !query.path) {

Callers 15

selectResultFunction · 0.85
selectMetadataFunction · 0.85
selectMessagesFunction · 0.85
selectSessionFunction · 0.85
selectStatisticsFunction · 0.85
selectSystemStatusFunction · 0.85
selectRoleFunction · 0.85
selectCollectionFunction · 0.85
selectEntityFunction · 0.85
selectEntitySetFunction · 0.85
selectEntitySetItemFunction · 0.85
selectProfileFunction · 0.85

Calls 3

loadStateFunction · 0.90
selectTimestampFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected