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

Function getConnConfigKeyAtom

frontend/app/store/global.ts:159–173  ·  view source on GitHub ↗
(connName: string, key: T)

Source from the content-addressed store, hash-verified

157}
158
159function getConnConfigKeyAtom<T extends keyof ConnKeywords>(connName: string, key: T): Atom<ConnKeywords[T]> {
160 if (isPreviewWindow()) return NullAtom as Atom<ConnKeywords[T]>;
161 const connCache = getSingleConnAtomCache(connName);
162 const keyAtomName = "#conn-" + key;
163 let keyAtom = connCache.get(keyAtomName);
164 if (keyAtom != null) {
165 return keyAtom;
166 }
167 keyAtom = atom((get) => {
168 const fullConfig = get(atoms.fullConfigAtom);
169 return fullConfig.connections?.[connName]?.[key];
170 });
171 connCache.set(keyAtomName, keyAtom);
172 return keyAtom;
173}
174
175const settingsAtomCache = new Map<string, Atom<any>>();
176

Callers 1

getOverrideConfigAtomFunction · 0.85

Calls 4

isPreviewWindowFunction · 0.90
getSingleConnAtomCacheFunction · 0.85
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected