Skip to content

Commit

Permalink
fix(nestjs): move addProfile code to the micro task queue
Browse files Browse the repository at this point in the history
delay the addProfile operation for the DI to resolve all dependencies of Profile classes

#264
  • Loading branch information
nartc committed Feb 22, 2021
1 parent d730285 commit 70b268c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export abstract class AutomapperProfile {

protected constructor(mapper: Mapper) {
this.mapper = mapper;
this.mapper.addProfile(this.mapProfile());
Promise.resolve().then(() => this.mapper.addProfile(this.mapProfile()));
}

abstract mapProfile(): MappingProfile;
Expand Down

0 comments on commit 70b268c

Please sign in to comment.