MCPcopy Create free account
hub / github.com/CodeForBreakfast/eventsourcing / publishEventsWithBus

Function publishEventsWithBus

examples/todo-app/src/cli.ts:34–35  ·  view source on GitHub ↗
(todoId: TodoId, events: ReadonlyArray<TodoEvent>)

Source from the content-addressed store, hash-verified

32
33const publishEventsWithBus =
34 (todoId: TodoId, events: ReadonlyArray<TodoEvent>) => (eventBus: Readonly<EventBusService>) =>
35 pipe(events, Effect.forEach(eventBus.publish(todoId)));
36
37const publishEvents = (todoId: TodoId, events: ReadonlyArray<TodoEvent>) =>
38 pipe(EventBus, Effect.flatMap(publishEventsWithBus(todoId, events)));

Callers 1

publishEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected