MCPcopy
hub / github.com/react-native-community/upgrade-helper / fetchDiff

Function fetchDiff

src/hooks/fetch-diff.ts:30–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29 useEffect(() => {
30 const fetchDiff = async () => {
31 setIsLoading(true)
32 setIsDone(false)
33
34 const [response] = await Promise.all([
35 fetch(getDiffURL({ packageName, language, fromVersion, toVersion })),
36 delay(300),
37 ])
38
39 const diff = await response.text()
40
41 setDiff(movePackageJsonToTop(parseDiff(diff)))
42
43 setIsLoading(false)
44 setIsDone(true)
45
46 return
47 }
48
49 if (shouldShowDiff) {
50 fetchDiff()

Callers 1

useFetchDiffFunction · 0.85

Calls 3

getDiffURLFunction · 0.90
delayFunction · 0.85
movePackageJsonToTopFunction · 0.85

Tested by

no test coverage detected