Skip to content
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

Cleanup interface IProvider #58

Open
basedalexander opened this issue Oct 1, 2017 · 2 comments
Open

Cleanup interface IProvider #58

basedalexander opened this issue Oct 1, 2017 · 2 comments

Comments

@basedalexander
Copy link
Member

basedalexander commented Oct 1, 2017

I messed up interfaces for registered providers within Containers. They can't even be exported.

@basedalexander basedalexander self-assigned this Oct 1, 2017
@basedalexander basedalexander removed their assignment Oct 2, 2017
@basedalexander basedalexander changed the title Resolve types for IProvider Cleanup interface IProvider Oct 7, 2017
@Tolowe
Copy link
Contributor

Tolowe commented Dec 2, 2017

Hey I started looking a bit into this one last night, I'll try to get something and submit a PR. I'm thinking something like an interface per second param in the existing method e.g. IProvideClass, IProvideFactory, etc.

@basedalexander
Copy link
Member Author

basedalexander commented Dec 2, 2017

@Tolowe I thought of something like defining several interfaces named the same way. Buy they are structured a little bit differently.

interface IProvider { token: InjectionToken, useClass: Constructor }
interface IProvider { token: InjectionToken, useValue: InjectionValue }
interface IProvider { token: InjectionToken, useFactory: InjectionFactory }

Something like this. I've seen this technique is used a lot in libraries. Users of that container should clearly understand what object format should be provided. It's not really that important at this moment, but if you have some time to implement this, let us know here :)

basedalexander added a commit that referenced this issue Feb 25, 2018
feat: changed provider interface to merged interfaces. fixed mispell …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants