Skip to content

CHR0075: A reducer with a batch method has no other reduce methods

A reducer is a single fold over one event source’s events in order. Splitting those events between methods would break the fold, so a reducer has either per-event reduce methods or exactly one batch method. The batch method’s [Observes<TEvent>] list is the reducer’s whole set of event types. CHR0075 reports a reducer, or a self-reducing read model, that declares:

  • two batch methods
  • a batch method and per-event reduce methods

Error

Keep one batch method and add an [Observes<TEvent>] to it for each event type the other methods handled, folding them inside it. Or remove the batch method and keep per-event reduce methods.

  • CHR0072: An event type reaches more than one method.