MCPcopy Create free account
hub / github.com/SuboptimalEng/coding-tutorials / awaitJson

Function awaitJson

react-pokemon-kanban/src/components/Board.tsx:24–31  ·  view source on GitHub ↗
(responses: Response[])

Source from the content-addressed store, hash-verified

22 };
23
24 const awaitJson = (responses: Response[]) => {
25 return Promise.all(
26 responses.map((response) => {
27 if (response.ok) return response.json();
28 throw new Error(response.statusText);
29 })
30 );
31 };
32
33 fetch10Pokemon()
34 .then(awaitJson)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected