MCPcopy Index your code
hub / github.com/testing-library/react-hooks-testing-library / safeCallback

Function safeCallback

src/core/asyncUtils.ts:49–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 { interval = DEFAULT_INTERVAL, timeout = DEFAULT_TIMEOUT }: WaitForOptions = {}
48 ) => {
49 const safeCallback = () => {
50 try {
51 return callback()
52 } catch (error: unknown) {
53 return false
54 }
55 }
56
57 const result = await wait(safeCallback, { interval, timeout })
58 if (!result && timeout) {

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…