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

Function commitAndReturnId

examples/todo-app/src/cli.ts:70–75  ·  view source on GitHub ↗
(todoId: TodoId, eventNumber: number, title: string)

Source from the content-addressed store, hash-verified

68
69const commitAndReturnId =
70 (todoId: TodoId, eventNumber: number, title: string) =>
71 (events: Readonly<ReadonlyArray<TodoEvent>>) =>
72 pipe(
73 commitAndPublish(todoId, eventNumber, events, `✓ Created TODO: ${title} (${todoId})`),
74 Effect.as(todoId)
75 );
76
77const executeCreateTodo = (title: string) => TodoAggregateRoot.commands.createTodo(title)();
78

Callers 1

createTodoFunction · 0.85

Calls 1

commitAndPublishFunction · 0.85

Tested by

no test coverage detected