(listeners: ReadonlySet<(a: A) => void>, a: A)
| 5345 | } |
| 5346 | } |
| 5347 | const notify = <A>(listeners: ReadonlySet<(a: A) => void>, a: A): void => { |
| 5348 | for (const listener of Array.from(listeners)) { |
| 5349 | try { |
| 5350 | listener(a) |
| 5351 | } catch { |
| 5352 | // A listener can't change what the cache does. |
| 5353 | } |
| 5354 | } |
| 5355 | } |
| 5356 | /** Taken before any resumes: a caller resumed here can run before this returns, and call again. */ |
| 5357 | const resumeAll = <A>( |
| 5358 | waiters: Set<{ readonly resume: (exit: Exit.Exit<A, any>) => void }>, |