Comments (3)
Yes, if it were an interface you'd be able to use all the methods directly on the AppContext.
Conceptually it wouldn't be completely out of question for Dig to expose an interface that would be implemented by both Scope and Container so that you could do something like that.
Changing Container
to an interface is a breaking change. We follow semantic versioning rules and do not introduce any backwards-incompatible changes.
from dig.
may be we can add a new way to use Dig as a interface
from dig.
My current thought on this is that we probably won't do this, as making an interface for this limits the extensibility of it.
If we decide to support additional methods on the Container struct, adding such a method is not a breaking change. Adding a method to an interface, however, is a breaking change.
Given the tradeoffs, I believe Dig's current structure of returning the struct is a better design choice for us to continue iterating on more features.
Hope that makes sense.
from dig.
Related Issues (20)
- Decorators at parent level scope affects child only after an invoke at parent scope
- Add FillDecorateInfo DecorateOption HOT 1
- Result of multiple decorations of the same type depends on invocation order
- How to test dig container HOT 1
- Multiple decoration passes within same Scope does not work HOT 2
- dig.In help HOT 1
- Allow dig.As with dig.Group HOT 2
- Invoke order affects private provided types HOT 1
- dig "trace" mode HOT 2
- question. Reinitialization provide
- Ability to check if the error belongs to dig HOT 4
- Be able to define provider sets? HOT 1
- BUG: Stack overflow caused by too many dependencies or too deep nested dependencies HOT 2
- verifying go.uber.org/[email protected]: checksum mismatch HOT 5
- Root container provided function may look provided parameter in child scope too to resolve it's params HOT 1
- Allow name and group Result Tags
- Add support dig out anonymous field's member. HOT 6
- Not providing any value group does not return an error during invocation HOT 1
- Cyclic dependencies in decorators HOT 4
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 dig.