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

Function getShip

exercises/03.optimistic/03.problem.message/utils.tsx:19–23  ·  view source on GitHub ↗
(name: string, delay?: number)

Source from the content-addressed store, hash-verified

17const shipCache = new Map<string, Promise<Ship>>()
18
19export function getShip(name: string, delay?: number) {
20 const shipPromise = shipCache.get(name) ?? getShipImpl(name, delay)
21 shipCache.set(name, shipPromise)
22 return shipPromise
23}
24
25async function getShipImpl(name: string, delay?: number) {
26 const searchParams = new URLSearchParams({ name })

Callers 1

ShipDetailsFunction · 0.90

Calls 1

getShipImplFunction · 0.70

Tested by

no test coverage detected