-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experiment: diod di container #1
Conversation
builder.registerAndUse(ReferenceManager) | ||
|
||
builder.registerAndUse(GroupsRepository) | ||
builder.register(IdpAdapter).use(FirebaseAuthService).asSingleton() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hacky, just to get the POC to work. It's to avoid re-initializing the firebase SDK, which throws an error. Should be refactored.
builder.registerAndUse(GroupsRepository) | ||
builder.register(IdpAdapter).use(FirebaseAuthService).asSingleton() | ||
|
||
builder.register(UsersImplementation).use(UsersHandlers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I don't like about this is that it would seem to make it difficult inject things scoped/initialized with contextual configuration per request. Need experiment more with diod
to figure out the best patterns
playing around with using diod as a dependency injection container, using the changes from mnahkies/openapi-code-generator#256
notes:
import type
doesn't work withdiod
- removes the information it uses for auto-wiring I guesstsx
also won't work withdiod
since it bypasses the typescript compiler