Comments (4)
What makes this confusing? Each function is in the context of its own package (dig/task/dispatcher), has different arguments. It should be clear to the user from context/arguments/comments what it's doing.
from fx.
I suggest renaming dig.Register
to dig.Provide
.
Provide
is much more inline with what is actually occurring: a user is providing a type or constructor to the container, so that the object graph can be built.
Provide
is much more specific, and a better name AFAICT.
from fx.
I see. Register seems that way to me - a user is registering a type or constructor with the container, so that the object graph can be built.
Another commonly used function is "Run", it is clear what it is though, makes sense that it's used frequently.
So this doesn't get missed, pasting again - What makes this confusing? Each function is in the context of its own package (dig/task/dispatcher), has different arguments. It should be clear to the user from context/arguments/comments what it's doing.
from fx.
Closing - the modular
branch, and soon dev
, doesn't use the "Register" terminology in its API.
from fx.
Related Issues (20)
- app.Done() not notified when shutdown is called before all OnStart hooks have completed HOT 6
- Disallow using In/Out structs with From/As annotations HOT 1
- How to deal with request scoped lifecycle for database transient connections?
- Enable dark/night mode on documentation side HOT 2
- Terminate my application with exit code
- Documentation should have a copy button for code snippets HOT 1
- fx.OnStart dependency missing, sometimes HOT 3
- Error on invalid lifecycle hooks
- Handling optional fields in fx.Decorate HOT 3
- Multiple implementations HOT 3
- Optional dependency becomes required if there is a provider available HOT 1
- Factory like provider? HOT 3
- Refresh dependency HOT 5
- `fx.Decorate` not working w/ value groups HOT 3
- doc error on [register a handler with the server] HOT 2
- Fx exiting program before panic in OnStart hook gets reported HOT 1
- Add ability to override os.Exit for fxtest HOT 1
- fx.Evaluate: Support dynamic graphs by returning fx.Option from constructors
- https://github.com/benbjohnson/clock is EOL/archived. HOT 1
- fx.Decorate does not add a missing object to the module HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fx.