MCPcopy Index your code
hub / github.com/DeepNotesApp/DeepNotes / hgetAsync

Method hgetAsync

apps/client/src/code/realtime/context.ts:40–56  ·  view source on GitHub ↗
(prefix: DataPrefix_, suffix: string, field: DataField)

Source from the content-addressed store, hash-verified

38 );
39 }
40 async hgetAsync<
41 DataPrefix_ extends DataPrefix,
42 DataField extends Extract<
43 keyof (typeof dataHashes)[DataPrefix_]['fields'],
44 string
45 > = Extract<keyof (typeof dataHashes)[DataPrefix_]['fields'], string>,
46 >(prefix: DataPrefix_, suffix: string, field: DataField) {
47 this._subscribe(prefix, suffix, field);
48
49 const fullKey = getFullKey(prefix, suffix, field);
50
51 if (internals.realtime.isSynced(prefix as any, suffix, field)) {
52 return internals.realtime.values[fullKey];
53 }
54
55 return await internals.realtime.pending.get(fullKey);
56 }
57
58 mhgetCoalesce(items: [DataPrefix, string, string][]) {
59 for (const item of items) {

Calls 4

getFullKeyFunction · 0.90
_subscribeMethod · 0.80
isSyncedMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected