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

Method addObserver

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

Source from the content-addressed store, hash-verified

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

Callers 2

unsafeForkFunction · 0.95
runForkFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected