MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / getSettingsPrefixAtom

Function getSettingsPrefixAtom

frontend/app/store/global.ts:251–265  ·  view source on GitHub ↗
(prefix: string)

Source from the content-addressed store, hash-verified

249}
250
251function getSettingsPrefixAtom(prefix: string): Atom<SettingsType> {
252 if (isPreviewWindow()) return NullAtom as Atom<SettingsType>;
253 let settingsPrefixAtom = settingsAtomCache.get(prefix + ":");
254 if (settingsPrefixAtom == null) {
255 // create a stable, closured reference to use as the deepCompareReturnPrev key
256 const cacheKey = {};
257 settingsPrefixAtom = atom((get) => {
258 const settings = get(atoms.settingsAtom);
259 const newValue = getPrefixedSettings(settings, prefix);
260 return deepCompareReturnPrev(cacheKey, newValue);
261 });
262 settingsAtomCache.set(prefix + ":", settingsPrefixAtom);
263 }
264 return settingsPrefixAtom;
265}
266
267function getSingleBlockAtomCache(blockId: string): Map<string, Atom<any>> {
268 const blockORef = WOS.makeORef("block", blockId);

Callers 2

AppSettingsUpdaterFunction · 0.90
TerminalViewFunction · 0.90

Calls 5

isPreviewWindowFunction · 0.90
getPrefixedSettingsFunction · 0.90
deepCompareReturnPrevFunction · 0.90
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected