InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

Global activation hooks

Open captainjono opened this issue 9 years ago • 4 comments

Lets say i have a series of modules defined for an app. Each module adds certain features to the app. I know that modules will provide services that implement certain interfaces.

At runtime, i want to know when any of these services are first resolved from the container, either directly, or indirectly via a child dependency resolution.

Currently with middleware, i can only see a way to get access to an instance of the directly requested service. The only way i can get access to the instance of the child service is to use the OnActivation method thats created during the binding.

This is a cross cutting concern, i cant/or want to do this at registration time. It would be great if this could be supported. Currently im using a forked version of the repo to meet this requirement.

captainjono avatar Jan 05 '17 04:01 captainjono