MCPcopy
hub / github.com/mswjs/msw / next

Function next

test/memory/2735-memory-leak.test.ts:23–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22 return new Promise((resolve, reject) => {
23 const next = () => {
24 if (failed) {
25 return
26 }
27 if (started >= count && inflight === 0) {
28 return resolve()
29 }
30
31 while (inflight < concurrency && started < count) {
32 started++
33 inflight++
34 fetch(URL)
35 .then((r) => r.text())
36 .catch((error) => {
37 failed = true
38 reject(error)
39 })
40 .finally(() => {
41 inflight--
42 next()
43 })
44 }
45 }
46 next()
47 })
48}

Callers 4

cors.test.tsFile · 0.85
beforeNavigationFunction · 0.85
fireBatchFunction · 0.85

Calls 3

fetchFunction · 0.85
textMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…