(relPath: string, state: Store)
| 2869 | } |
| 2870 | |
| 2871 | function readNoteContent(relPath: string, state: Store): Promise<NoteContent> { |
| 2872 | const cacheKey = noteReadCacheKey(state, relPath) |
| 2873 | const pending = noteReadPromises.get(cacheKey) |
| 2874 | if (pending) return pending |
| 2875 | |
| 2876 | const next = window.zen.readNote(relPath).finally(() => { |
| 2877 | noteReadPromises.delete(cacheKey) |
| 2878 | }) |
| 2879 | noteReadPromises.set(cacheKey, next) |
| 2880 | return next |
| 2881 | } |
| 2882 | |
| 2883 | function rememberPrefetchedPath(path: string): void { |
| 2884 | const existing = prefetchedNotePaths.indexOf(path) |
no test coverage detected