MCPcopy Index your code
hub / github.com/simstudioai/sim / flush

Function flush

apps/sim/app/_shell/providers/session-provider.test.tsx:116–123  ·  view source on GitHub ↗

* Flush pending work inside an act() boundary. Drains the microtask queue and * then yields one macrotask tick, so React Query's notifyManager (which can * schedule observer notifications on a timer) and any deferred renders settle * deterministically — microtask-only flushing raced the query→ren

()

Source from the content-addressed store, hash-verified

114 * deterministically — microtask-only flushing raced the query→render update.
115 */
116async function flush() {
117 await act(async () => {
118 await Promise.resolve()
119 await Promise.resolve()
120 await Promise.resolve()
121 await new Promise<void>((resolve) => setTimeout(resolve, 0))
122 })
123}
124
125/** Repeatedly flush until `predicate` holds or the budget runs out. */
126async function flushUntil(predicate: () => boolean, attempts = 40) {

Callers 2

flushUntilFunction · 0.70

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected