NestJS · Senior · Question 7 of 75

How can you discover all providers with a custom decorator at startup, e.g. to register event handlers automatically?

Explanation

Libraries like @nestjs/cqrs and @nestjs/schedule use the same scanning mechanism.

Further reading

Problem with a question

NestJS · Senior · question 7

Test yourself

Take the NestJS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz