Skip to content

Commit

Permalink
Refactor configuration method in Projects decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Castro, Mario committed Aug 28, 2024
1 parent f4023b3 commit d4d63a0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/framework-core/src/decorators/projects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Booster } from '../booster'
import {
BoosterConfig,
Class,
EntityInterface,
ProjectionInfo,
Expand Down Expand Up @@ -60,7 +59,7 @@ function registerProjection(
projectionMetadata: ProjectionMetadata<EntityInterface, ReadModelInterface>
): void {
Booster.configureCurrentEnv((config): void => {
configure(config, originName, projectionMetadata, config.projections)
configure(originName, projectionMetadata, config.projections)
})
}

Expand All @@ -69,12 +68,11 @@ function registerUnProjection(
projectionMetadata: ProjectionMetadata<EntityInterface, ReadModelInterface>
): void {
Booster.configureCurrentEnv((config): void => {
configure(config, originName, projectionMetadata, config.unProjections)
configure(originName, projectionMetadata, config.unProjections)
})
}

function configure(
config: BoosterConfig,
originName: string,
projectionMetadata: ProjectionMetadata<EntityInterface, ReadModelInterface>,
configuration: Record<string, Array<ProjectionMetadata<EntityInterface, ReadModelInterface>>>
Expand Down

0 comments on commit d4d63a0

Please sign in to comment.