MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / createPending

Function createPending

src/hooks/asyncImageCacheState.test.ts:11–20  ·  view source on GitHub ↗
(
  cacheKey: string,
  resolve: (result: T | null) => void = vi.fn()
)

Source from the content-addressed store, hash-verified

9} from './asyncImageCacheState';
10
11function createPending<T>(
12 cacheKey: string,
13 resolve: (result: T | null) => void = vi.fn()
14): AsyncImageCachePendingItem<T> {
15 return {
16 bitmap: buildImageBitmap({ close: vi.fn() }),
17 cacheKey,
18 resolve,
19 };
20}
21
22describe('async image cache state helpers', () => {
23 it('creates empty cache state with default lifecycle flags', () => {

Callers 1

Calls 1

buildImageBitmapFunction · 0.90

Tested by

no test coverage detected