-
Notifications
You must be signed in to change notification settings - Fork 294
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
Handling optional fields in fx.Decorate #1093
Comments
Hi @mehdihadeli , thanks for submitting an issue. Decorators actually allow optional dependencies with The issue in your code is because your |
Hi @sywhang, thanks for your quick response. I'm looking for a way that if one struct like |
@mehdihadeli Might be a better way to do this, but off the top of my head, you can accomplish this by using a name tag for the final logger you want to use. Something like:
Then if a logger is already provided it will be passed along as |
Hi,
Is there any way for handling optional input parameter in
fx.decorate
method?Actually, I'm looking for a way if, in one of my sub
module
s, one dependency like*Test
not provided, I can instantiate it; otherwise, I want to return an existing register object.Error:
The text was updated successfully, but these errors were encountered: