Hierarchy
-
PersistedReduceProjection
Constructors
constructor
-
Parameters
-
-
-
Default value eventFilter: function = (e) => true
-
-
Parameters
Returns boolean
Properties
Private eventFilter
eventFilter: function
Type declaration
-
-
Parameters
Returns boolean
Methods
handleEvent
- handleEvent(event: Event): Promise<void>
-
Parameters
Returns Promise<void>
rebuildStream
- rebuildStream(): Writable
A projection that stores its latest state in a storage.
const projection = new PersistedReduceProjection(nbMealsReducer); bus.onEvent((event) => projection.handleEvent(event)); const nbMeals = await projection.getState();