MCPcopy Create free account
hub / github.com/Effect-TS/effect / wake

Function wake

packages/effect/src/ui/Router.ts:2288–2297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2286 ) => void)
2287 | undefined
2288 const wake = () => {
2289 if (resume === undefined || pending.length === 0) return
2290 const r = resume
2291 resume = undefined
2292 r(
2293 Effect.succeed(
2294 pending.splice(0) as [A, ...Array<A>]
2295 )
2296 )
2297 }
2298 const listener = (next: A) => {
2299 pending.push(next)
2300 if (resume !== undefined) wakes.push(wake)

Callers 6

offerMethod · 0.70
changesMethod · 0.70
drainFunction · 0.70
stopRunningFunction · 0.50

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected