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

Function handle

packages/effect/src/unstable/eventlog/EventLog.ts:493–510  ·  view source on GitHub ↗
(
    this: Handlers<any, any>,
    tag: Tag,
    handler: (payload: unknown) => Effect.Effect<unknown, unknown, R1>
  )

Source from the content-addressed store, hash-verified

491 _Events: identity
492 },
493 handle<Tag extends string, R1>(
494 this: Handlers<any, any>,
495 tag: Tag,
496 handler: (payload: unknown) => Effect.Effect<unknown, unknown, R1>
497 ): Handlers<any, any> {
498 return makeHandlers({
499 group: this.group,
500 context: this.context,
501 handlers: {
502 ...this.handlers,
503 [tag]: {
504 event: Object.hasOwn(this.group.events, tag) ? this.group.events[tag] : undefined!,
505 context: this.context,
506 handler
507 }
508 }
509 })
510 },
511 pipe() {
512 return pipeArguments(this, arguments)
513 }

Callers

nothing calls this directly

Calls 1

makeHandlersFunction · 0.70

Tested by

no test coverage detected