-
Notifications
You must be signed in to change notification settings - Fork 298
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
docs: Define Container, fx.Provide, fx.Supply, fx.Invoke #1156
Conversation
Adds documentation defining the concept of a container and a couple of the core intrinsic operations that a container suppotrs. In the future, this should include `fx.Decorate` as an operation, and can link to more thorough documentation about decoration separately.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1156 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 30 30
Lines 2950 2950
=======================================
Hits 2913 2913
Misses 30 30
Partials 7 7 ☔ View full report in Codecov by Sentry. |
Hm, mdox and vuepress disagree here. I'll just use an explicit anchor. |
Never mind, it appears that mdox is just broken for this case. I'm going to work around this for now, but we should consider dropping its link validation completely in that case. |
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.
Nice! Thanks for this addition. LGTM - just left one question.
```go | ||
package fx | ||
|
||
type App | ||
func New(opts ...Option) *App | ||
func (app *App) Run() | ||
|
||
type Option | ||
func Provide(constructors ...interface{}) Option | ||
func Invoke(funcs ...interface{}) Option | ||
``` |
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.
I think your intention is to show some relevant functions for this section and their relevent types, but this throws me off a little because its formatted as a code block and yet isn't really valid Go syntax. I think it's fine, just something to be aware of. Is this a common format for trying to portray this kind of information that I'm not aware of?
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.
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.
Ah okay! Makes sense. I think this is good then.
Adds documentation defining the concept of a container
and a couple of the core intrinsic operations that a container suppotrs.
In the future, this should include
fx.Decorate
as an operation,and can link to more thorough documentation about decoration separately.