MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / factory

Function factory

apps/api/tests/lib/cache/cache.service.test.ts:44–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 let calls = 0;
43
44 const factory = (): Promise<number> => {
45 calls += 1;
46
47 return Promise.resolve(99);
48 };
49
50 const first = await cacheService.wrap(key, factory, { ttlSeconds: 60 });
51 const second = await cacheService.wrap(key, factory, { ttlSeconds: 60 });

Callers 5

wrapMethod · 0.50
wrapMethod · 0.50
wrapMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected