(index: number)
| 5 | |
| 6 | /** Get thick file diff information from the server. */ |
| 7 | export async function getThickDiff(index: number): Promise<ThickDiff> { |
| 8 | const {cache} = getThickDiff; |
| 9 | if (cache[index]) { |
| 10 | return cache[index]; |
| 11 | } |
| 12 | |
| 13 | const response = await fetch(`/thick/${index}`); |
| 14 | const data = (await response.json()) as ThickDiff; |
| 15 | cache[index] = data; |
| 16 | return data; |
| 17 | } |
| 18 | getThickDiff.cache = [] as ThickDiff[]; |
| 19 | |
| 20 | // Useful for avoiding capturing keyboard shortcuts and text entry. |