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

Function getOrefMetaKeyAtom

frontend/app/store/global.ts:139–153  ·  view source on GitHub ↗
(oref: string, key: T)

Source from the content-addressed store, hash-verified

137}
138
139function getOrefMetaKeyAtom<T extends keyof MetaType>(oref: string, key: T): Atom<MetaType[T]> {
140 const orefCache = getSingleOrefAtomCache(oref);
141 const metaAtomName = "#meta-" + key;
142 let metaAtom = orefCache.get(metaAtomName);
143 if (metaAtom != null) {
144 return metaAtom;
145 }
146 metaAtom = atom((get) => {
147 const objAtom = WOS.getWaveObjectAtom(oref);
148 const objData = get(objAtom);
149 return objData?.meta?.[key];
150 });
151 orefCache.set(metaAtomName, metaAtom);
152 return metaAtom;
153}
154
155function useOrefMetaKeyAtom<T extends keyof MetaType>(oref: string, key: T): MetaType[T] {
156 return useAtomValue(getOrefMetaKeyAtom(oref, key));

Callers 8

constructorMethod · 0.90
constructorMethod · 0.90
getPanelOpenAtomMethod · 0.90
getPanelWidthAtomMethod · 0.90
getVTabBarWidthAtomMethod · 0.90
buildTabContextMenuFunction · 0.90
getTabMetaKeyAtomFunction · 0.85
useOrefMetaKeyAtomFunction · 0.85

Calls 3

getSingleOrefAtomCacheFunction · 0.85
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected