Reputation: 130
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
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