(connName: string, key: T)
| 157 | } |
| 158 | |
| 159 | function 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 | |
| 175 | const settingsAtomCache = new Map<string, Atom<any>>(); |
| 176 |
no test coverage detected