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

Function commitTodoEvents

examples/todo-app/src/cli.ts:40–49  ·  view source on GitHub ↗
(
  todoId: TodoId,
  eventNumber: number,
  events: Readonly<ReadonlyArray<TodoEvent>>
)

Source from the content-addressed store, hash-verified

38 pipe(EventBus, Effect.flatMap(publishEventsWithBus(todoId, events)));
39
40const commitTodoEvents = (
41 todoId: TodoId,
42 eventNumber: number,
43 events: Readonly<ReadonlyArray<TodoEvent>>
44) =>
45 TodoAggregateRoot.commit({
46 id: todoId,
47 eventNumber,
48 events: Chunk.fromIterable(events),
49 });
50
51const commitAndPublish = (
52 todoId: TodoId,

Callers 1

commitAndPublishFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected