320x100
320x100

https://docs.nestjs.com/fundamentals/circular-dependency

 

Documentation | NestJS - A progressive Node.js framework

Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Rea

docs.nestjs.com

https://docs.nestjs.com/fundamentals/lazy-loading-modules

 

Documentation | NestJS - A progressive Node.js framework

Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Rea

docs.nestjs.com

 

 

1. @Inject(forwardRef(() => service)) 키워드를 통해 아직 정의되지 않은 클래스를 참조할 수 있게 하여 순환 참조 문제를 해결

 

2. DTO의 경우 @Apiproperty({ type: () => dto }) 키워드를 통해 lazy loader가 가능

 

3. 모듈은 LazyModuleLoader 를 활용하여 로딩을 늦춰 순환참조 문제 해결 가능

300x250
728x90