booster
booster copied to clipboard
[Question] How to get the event date in a reducer
Goal: createdAt, updatedAt fields on an entity & read model.
@thomas-advantitge, You can create a "createdAt" field on the event and call "new Date().toISOString()" each time you register it.
This is indeed how we solve it right now. Nevertheless, it might be a nice feature to access the event metadata (like creation date) from reducers?
In the particular case of createdAt and updatedAt: this is something which could be added to most read models as most read models are linked to a "detail page" in a web application, typically showing a name and a date as basic information of the object.