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

Function commitAndPublish

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

Source from the content-addressed store, hash-verified

49 });
50
51const commitAndPublish = (
52 todoId: TodoId,
53 eventNumber: number,
54 events: Readonly<ReadonlyArray<TodoEvent>>,
55 successMessage: string
56) =>
57 pipe(
58 commitTodoEvents(todoId, eventNumber, events),
59 Effect.andThen(publishEvents(todoId, events)),
60 Effect.andThen(Console.log(successMessage))
61 );
62
63const handleConditional = <E, R>(
64 events: Readonly<ReadonlyArray<unknown>>,

Callers 2

commitAndReturnIdFunction · 0.85
processCommandFunction · 0.85

Calls 2

commitTodoEventsFunction · 0.85
publishEventsFunction · 0.85

Tested by

no test coverage detected