MCPcopy Create free account
hub / github.com/TanStack/query / fetchMovie

Function fetchMovie

examples/react/react-native/src/lib/api.ts:33–44  ·  view source on GitHub ↗
(title: string)

Source from the content-addressed store, hash-verified

31}
32
33export async function fetchMovie(title: string): Promise<MovieDetails> {
34 console.log('fetchMovie', title)
35
36 await delay(200 + Math.floor(Math.random() * 2000))
37
38 const result = movies.filter((item) => item.title === title)
39
40 if (result.length === 0) {
41 throw new Error('Movie not found')
42 }
43 return Promise.resolve(result[0] as MovieDetails)
44}

Callers 1

MovieDetailsScreenFunction · 0.90

Calls 1

delayFunction · 0.70

Tested by

no test coverage detected