September 2023
Intermediate to advanced
470 pages
11h 12m
English
After having prepared events and states, now we start going back to our commands and implementing them, starting from CreateToDoList.
Each command can either generate a list of events or fail. Even if most of the commands will emit a single event, there are cases—as we’ll see in the following chapters—where a command needs to generate multiple events. Where should this happen? That would be in our CommandHandler function we started to discuss in Using Commands to Change the State.
Let’s visualize it with a diagram:

As you see, events determine the state, and commands use the state to generate new events.
Read now
Unlock full access