MCPcopy
hub / github.com/testing-library/react-hooks-testing-library / waitForNextUpdate

Function waitForNextUpdate

src/core/asyncUtils.ts:75–87  ·  view source on GitHub ↗
({
    timeout = DEFAULT_TIMEOUT
  }: WaitForNextUpdateOptions = {})

Source from the content-addressed store, hash-verified

73 }
74
75 const waitForNextUpdate = async ({
76 timeout = DEFAULT_TIMEOUT
77 }: WaitForNextUpdateOptions = {}) => {
78 let updated = false
79 addResolver(() => {
80 updated = true
81 })
82
83 const result = await wait(() => updated, { interval: false, timeout })
84 if (!result && timeout) {
85 throw new TimeoutError(waitForNextUpdate, timeout)
86 }
87 }
88
89 return {
90 waitFor,

Callers 3

asyncHook.test.tsFile · 0.85
errorHook.test.tsFile · 0.85

Calls 1

waitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…