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