(columns: number, key: string, height: number)
| 93 | } |
| 94 | |
| 95 | function writeSharedHeight(columns: number, key: string, height: number): void { |
| 96 | const cacheKey = sharedHeightCacheKey(columns, key) |
| 97 | if (sharedHeightCache.get(cacheKey) === height) { |
| 98 | sharedHeightCache.delete(cacheKey) |
| 99 | sharedHeightCache.set(cacheKey, height) |
| 100 | return |
| 101 | } |
| 102 | if (sharedHeightCache.size >= SHARED_HEIGHT_CACHE_MAX) { |
| 103 | const oldest = sharedHeightCache.keys().next().value |
| 104 | if (oldest !== undefined) sharedHeightCache.delete(oldest) |
| 105 | } |
| 106 | sharedHeightCache.set(cacheKey, height) |
| 107 | } |
| 108 | |
| 109 | export type VirtualScrollColdStartRangeInput = { |
| 110 | itemKeys: readonly string[] |
no test coverage detected