MCPcopy Index your code
hub / github.com/Effect-TS/effect / addObserver

Method addObserver

packages/effect/src/Micro.ts:484–496  ·  view source on GitHub ↗
(cb: (exit: MicroExit<A, E>) => void)

Source from the content-addressed store, hash-verified

482 }
483
484 addObserver(cb: (exit: MicroExit<A, E>) => void): () => void {
485 if (this._exit) {
486 cb(this._exit)
487 return constVoid
488 }
489 this._observers.push(cb)
490 return () => {
491 const index = this._observers.indexOf(cb)
492 if (index >= 0) {
493 this._observers.splice(index, 1)
494 }
495 }
496 }
497
498 _interrupted = false
499 unsafeInterrupt(): void {

Callers 2

unsafeForkFunction · 0.95
runForkFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected