marciopd
marciopd

Reputation: 130

Is it possible to intercept providers in Nest.js?

I'm trying to intercept Nest.js providers and it doesn't seem to work.

Can anyone confirm this? If yes, is there any specific design reason for that?

Usually it's possible to intercept any bean in dependency injection containers.

Upvotes: 3

Views: 1589

Answers (1)

Kim Kern
Kim Kern

Reputation: 60367

As Kamil wrote in this issue:

it's impossible

In this issue, he gives the following explanation:

because it could break too many existing codebases


But of course, you can always create your own custom decorators that also work on any class methods to enable aspect-oriented programming on providers.

Upvotes: 5

Related Questions