Open snordquist opened 10 months ago
Currently, I try to use next-api-decorators in combination with tsyringe for dependency injection.
In order to get this to work I had to allow the container instance to instantiate the handler class.
container
(e.g. container.resolve(cls) instead of new cls())
container.resolve(cls)
new cls()
It would be nice if next-api-decorators would allow me to provide the instance
https://github.com/instantcommerce/next-api-decorators/blob/0b618bd8d43b4d47b3ac3f8d50bd77d3971bc6e3/lib/createHandler.ts#L28
Currently, I try to use next-api-decorators in combination with tsyringe for dependency injection.
In order to get this to work I had to allow the
container
instance to instantiate the handler class.(e.g.
container.resolve(cls)
instead ofnew cls()
)It would be nice if next-api-decorators would allow me to provide the instance
https://github.com/instantcommerce/next-api-decorators/blob/0b618bd8d43b4d47b3ac3f8d50bd77d3971bc6e3/lib/createHandler.ts#L28