Function
waitForCollectionSize
(
collection: Collection<T>,
expectedSize: number,
timeout = 5000,
)
Source from the content-addressed store, hash-verified
| 91 | * Wait for a collection to reach a specific size |
| 92 | */ |
| 93 | export async function waitForCollectionSize<T extends object>( |
| 94 | collection: Collection<T>, |
| 95 | expectedSize: number, |
| 96 | timeout = 5000, |
| 97 | ): Promise<void> { |
| 98 | await waitFor(() => collection.size === expectedSize, { |
| 99 | timeout, |
| 100 | message: `Collection size did not reach ${expectedSize} (current: ${collection.size})`, |
| 101 | }) |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Wait for collection to finish loading (status === 'ready') |
Callers
nothing calls this directly
Tested by
no test coverage detected