MCPcopy Create free account
hub / github.com/anomalyco/opencode / observe

Function observe

packages/core/src/event.ts:398–404  ·  view source on GitHub ↗
(event: Payload, observer: (event: Payload) => Effect.Effect<void>)

Source from the content-addressed store, hash-verified

396 }
397
398 const observe = (event: Payload, observer: (event: Payload) => Effect.Effect<void>) =>
399 Effect.suspend(() => observer(event)).pipe(
400 Effect.catchCauseIf(
401 (cause) => !Cause.hasInterrupts(cause),
402 (cause) => Effect.logError("Event listener failed", { eventID: event.id, eventType: event.type, cause }),
403 ),
404 )
405
406 function notify(event: Payload, isolateListeners: boolean) {
407 return Effect.gen(function* () {

Callers 2

notifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected