MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getWaveObjectAtom

Function getWaveObjectAtom

frontend/app/store/wos.ts:213–223  ·  view source on GitHub ↗
(oref: string)

Source from the content-addressed store, hash-verified

211const waveObjectDerivedAtomCache = new Map<string, Atom<any>>();
212
213function getWaveObjectAtom<T extends WaveObj>(oref: string): Atom<T> {
214 const cacheKey = oref + ":value";
215 let cachedAtom = waveObjectDerivedAtomCache.get(cacheKey) as Atom<T>;
216 if (cachedAtom != null) {
217 return cachedAtom;
218 }
219 const wov = getWaveObjectValue<T>(oref);
220 cachedAtom = atom((get) => get(wov.dataAtom).value);
221 waveObjectDerivedAtomCache.set(cacheKey, cachedAtom);
222 return cachedAtom;
223}
224
225function getWaveObjectLoadingAtom(oref: string): Atom<boolean> {
226 const cacheKey = oref + ":loading";

Callers 1

isWaveObjectNullAtomFunction · 0.70

Calls 3

getWaveObjectValueFunction · 0.85
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected