MCPcopy Create free account
hub / github.com/epicweb-dev/react-suspense / getShip

Function getShip

exercises/04.image/02.problem.error/utils.tsx:7–11  ·  view source on GitHub ↗
(name: string, delay?: number)

Source from the content-addressed store, hash-verified

5const shipCache = new Map<string, Promise<Ship>>()
6
7export function getShip(name: string, delay?: number) {
8 const shipPromise = shipCache.get(name) ?? getShipImpl(name, delay)
9 shipCache.set(name, shipPromise)
10 return shipPromise
11}
12
13async function getShipImpl(name: string, delay?: number) {
14 const searchParams = new URLSearchParams({ name })

Callers 1

ShipDetailsFunction · 0.90

Calls 1

getShipImplFunction · 0.70

Tested by

no test coverage detected