Skip to content

Read models: access to previous projection state #85

@TomKaltz

Description

@TomKaltz

Currently projection functions aren't given the previous state, like aggregates "on" handlers get. This can sometimes pose a problem when you want to keep your event data slim and only carry domain intent without extraneous data needed to calculate the next read model state. Since we have guaranteed ordering of event processing, should the framework feed the previous state of the projection to the projection event processor by default?

One way to overcome this is to query for the previous state of the same projection when handling the event but it feels wrong. I believe this to be a correct way of handling the issue but it also feels verbose to do so. Am I thinking about this wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions