-
Notifications
You must be signed in to change notification settings - Fork 122
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
feature(injector): PartialFactory #487
Conversation
a72234d
to
9c20dca
Compare
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #487 +/- ##
==========================================
+ Coverage 78.44% 78.57% +0.12%
==========================================
Files 175 175
Lines 18644 18695 +51
Branches 4867 4882 +15
==========================================
+ Hits 14625 14689 +64
+ Misses 4019 4006 -13
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
d9d978e
to
c9ff318
Compare
@@ -808,7 +837,8 @@ export class Injector implements InjectorInterface { | |||
} | |||
current = current.indexAccessOrigin.container; | |||
} | |||
return () => config; | |||
|
|||
if (config) return () => config; |
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.
Had to change this to support creating factories for interfaces without having to Inject<.>
every property. Interface properties always have a property.type.indexAccessOrigin
set, which triggers config lookup. Without this change it would always return undefined (which was undesirable behavior in the first place I think)
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.
Yeah this broke some stuff. Fixed in c4ed83a
c9ff318
to
3bb7984
Compare
awesome, thanks! |
Summary of changes
Utility PartialFactory type that makes it easy to resolve providers when instantiating non-provider classes.
Relinquishment of Rights
Please mark following checkbox to confirm that you relinquish all rights of your changes: