EventSourceableRepository
Hierarchy
- EventSourceableRepository
 
Implements
- EventSourceableRepository
 - EventSourceableRepository
 
Index
Methods
Methods
find
▸ find(EventSourceableType: EventSourceableType, eventSourceableId: string | Guid): Promise‹EventSourceable | undefined›
Implementation of EventSourceableRepository
Returns a re-hydrated instance of event sourceable.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
EventSourceableType | EventSourceableType | Event sourceable type(constructor). | 
eventSourceableId | string | Guid | Identifier as string or Guid instance. | 
Returns: Promise‹EventSourceable | undefined›
Instance implementing EventSourceable interface, else undefined.
getSnapshotOf
▸ getSnapshotOf(EventSourceableType: EventSourceableType, eventSourceableId: string | Guid): Promise‹EventSourceable | undefined›
Implementation of EventSourceableRepository
Returns snapshot of EventSourceable by identifier.
async 
throws {UndefinedSnapshotterError}
Thrown f the snapshotter is not available on IoC.
Parameters:
| Name | Type | Description | 
|---|---|---|
EventSourceableType | EventSourceableType | Event sourceable type(constructor). | 
eventSourceableId | string | Guid | Identifier as string or Guid instance. | 
Returns: Promise‹EventSourceable | undefined›
Instance implementing EventSourceable interface, else undefined.
hasBySourceId
▸ hasBySourceId(eventSourceableId: string | Guid): Promise‹boolean›
Implementation of EventSourceableRepository
Evaluates whether event sourceable with id already exists.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceableId | string | Guid | Identifier as string or Guid instance. | 
Returns: Promise‹boolean›
Returns true if event sourceable exists, else false.
isSnapshotting
▸ isSnapshotting(): boolean
Implementation of EventSourceableRepository
Evaluates if application is snapshotting.
Returns: boolean
Returns true if snapshotting is enabled on application, else false.
makeSnapshotOf
▸ makeSnapshotOf(eventSourceable: EventSourceable): Promise‹string | undefined›
Implementation of EventSourceableRepository
Makes a snapshot of EventSourceable.
async 
throws {UndefinedSnapshotterError}
Thrown f the snapshotter is not available on IoC.
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceable | EventSourceable | Instance implementing EventSourceable interface. | 
Returns: Promise‹string | undefined›
String identifier for made snapshot on storage.
save
▸ save(eventSourceable: EventSourceable): Promise‹StorageIdentifiers›
Implementation of EventSourceableRepository
Persists event sourceable.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceable | EventSourceable | Instance implementing EventSourceable interface. | 
Returns: Promise‹StorageIdentifiers›
Object implementing StorageIdentifiers interface.