a function that the store will call each time you request an entity. An Entity constructor is perfect here.
the id of the entity
the current DecisionSequence (decision projection + sequence of last event)
the publish method to call when the entity wants to emit an event
the event to publish
the DecisionSequence up to date with the event to publish
an object to get the decision state for an entity
the publish method that will be passed to the entities
a function that the store will call each time you request an entity. An Entity constructor is perfect here.
an object to get the decision state for an entity
the publish method that will be passed to the entities
an entity id
an entity initialized with its decision projection and ready to emit events
Generated using TypeDoc
The object that you need to create your entities from the underlying storage.
const catStore = new Store<Cat, boolean>( (id, decisionProjection, publish) => new Cat(id, decisionProjection, publish), catDecisionProvider, (event) => bus.publish(event), ); const felix = await catStore.get("felix");