(oref: string)
| 211 | const waveObjectDerivedAtomCache = new Map<string, Atom<any>>(); |
| 212 | |
| 213 | function 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 | |
| 225 | function getWaveObjectLoadingAtom(oref: string): Atom<boolean> { |
| 226 | const cacheKey = oref + ":loading"; |
no test coverage detected