Skip to content

beforeApply phase #37

@wmertens

Description

@wmertens

We need a phase that allows checking the reducer results while the database is still unchanged. That way, subevents can be created with information about the delta.

Two approaches:

  • provide the frozen event object and allow addEvent. This requires knowledge in other models about what the reducer output means for a certain model.
  • during apply, run callbacks with previous and new state. This requires cooperation from the ESDBModels and removes semantic information.

The first approach seems less invasive and retains semantics, so let's do that. The knowledge requirement isn't that terrible because you need to know what the model stores anyway, otherwise you couldn't make useful subevents.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions