Skip to content

Commit

Permalink
Merge pull request #721 from fraktalio/feature/metadata-materialized-…
Browse files Browse the repository at this point in the history
…view

IViewStateRepository can fetch the state by Event Metadata now.
  • Loading branch information
idugalic authored Apr 12, 2024
2 parents c6194af + 2cc892d commit eff3ce7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/application/materialized-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export interface IViewStateRepository<E, S, V, EM> {
/**
* Fetch state
*
* @param event - Event of type `E`
* @param event - Event of type `E` with metadata of type `EM`
*
* @return current state / `S` with version / `V`, or NULL
*/
readonly fetch: (event: E) => Promise<(S & V) | null>;
readonly fetch: (event: E & EM) => Promise<(S & V) | null>;
/**
* Save state
*
Expand Down Expand Up @@ -98,7 +98,7 @@ export class MaterializedView<S, E, V, EM>
return this.view.evolve(state, event);
}

async fetch(event: E): Promise<(S & V) | null> {
async fetch(event: E & EM): Promise<(S & V) | null> {
return this.viewStateRepository.fetch(event);
}

Expand Down

0 comments on commit eff3ce7

Please sign in to comment.