You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this library, and thanks to that, it is exactly what I was looking for !
I try to use it, I could use decorators for my express app, but I admit it was a little tricky, I don't find more documentation but readmes in differents project.
For the container, it's unclear whether I should use:
the instance in @decorators/express (works better for me)
the instance RootContainer in @decorators/di (makes more sense to me, but breaks my controllers using decorators)
create my own instance (why not, but same, I can't use decorators, services are registered in the express one)
@decorators/di, "Container" is the class, not an instance
I see in the example @decorators/server that it's using "Container", but seems to be outdated, as it uses di 1.0, I'm using the v3.
Is there an up-to-date example or documentation I can use ?
I also checked this issue #119 with the example, but also outdated I think, I can't use import { Container } from '@decorators/di';, it is a class, not an instance
The text was updated successfully, but these errors were encountered:
I'm playing with express, socket io, and want to build more maintenable app using controllers as classes, separate all my websocket message in multiple classes/files and using decorators, use di...
Hi @alcalyn you should use Container out of @decorators/express package. @decorators/di package returns few major things: RootContainer the singleton to work with and Container class to have an ability to create several containers. At the moment @decorators/express uses Container and creates its own root container. I think I would replace this behavior in favor of RootContainer.
I found this library, and thanks to that, it is exactly what I was looking for !
I try to use it, I could use decorators for my express app, but I admit it was a little tricky, I don't find more documentation but readmes in differents project.
For the container, it's unclear whether I should use:
@decorators/express
(works better for me)@decorators/di
(makes more sense to me, but breaks my controllers using decorators)@decorators/di
, "Container" is the class, not an instanceI see in the example
@decorators/server
that it's using "Container", but seems to be outdated, as it uses di 1.0, I'm using the v3.Is there an up-to-date example or documentation I can use ?
I also checked this issue #119 with the example, but also outdated I think, I can't use
import { Container } from '@decorators/di';
, it is a class, not an instanceThe text was updated successfully, but these errors were encountered: