Behaviour for read slices (read models), and the read that serves them.
Pick from history, fold into current state, project what the screen gets.
There is no table and no materialised projection: the view is computed on
every call, by read/3.
query/1— what to read, from the call's arguments.next_query/1(optional) — what else to read, given what's folded so far: the plots of the receptions of a lot can't be named before the lot is read. It returns every follow-up query the state implies;read/3reads only the ones it hasn't read yet and stops when none are new.initial_state/0,apply_event/2— the fold.project/2(optional) — the read model, from the folded state and the call's arguments. Without it, the state is the read model.
Summary
Functions
The read with the store passed in: read_model.query(args), then next_query/1
until nothing new, the fold, and project/2. Returns {view, every_query_item_read}. Production reads FACT; Datumo.Scenario reads the
scenario's given, so a test runs this same code.
Callbacks
Functions
The read with the store passed in: read_model.query(args), then next_query/1
until nothing new, the fold, and project/2. Returns {view, every_query_item_read}. Production reads FACT; Datumo.Scenario reads the
scenario's given, so a test runs this same code.