huge refactor done
This commit is contained in:
parent
843a7b9b9b
commit
60d7de1da8
16 changed files with 472 additions and 443 deletions
|
|
@ -3,7 +3,7 @@
|
|||
* Discovers and registers handlers with the DI container
|
||||
*/
|
||||
|
||||
import { asClass, type AwilixContainer } from 'awilix';
|
||||
import { asClass, asFunction, type AwilixContainer } from 'awilix';
|
||||
import { glob } from 'glob';
|
||||
import type {
|
||||
HandlerConfiguration,
|
||||
|
|
@ -157,7 +157,9 @@ export class HandlerScanner {
|
|||
// Register with DI container if auto-register is enabled
|
||||
if (this.options.autoRegister !== false) {
|
||||
this.container.register({
|
||||
[handlerName]: asClass(HandlerClass).singleton(),
|
||||
[handlerName]: asFunction(({ serviceContainer }) => {
|
||||
return new HandlerClass(serviceContainer);
|
||||
}).singleton(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue