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

Use Symbol as DI token #1177

Closed
soanvig opened this issue Oct 6, 2018 · 4 comments
Closed

Use Symbol as DI token #1177

soanvig opened this issue Oct 6, 2018 · 4 comments

Comments

@soanvig
Copy link

soanvig commented Oct 6, 2018

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

@Module decorator's exports parameter expects string or other various types. It doesn't support Symbol (which is recommended for DI token e.g. by Inversify - it also makes perfect sense to use Symbol).

For now Symbol worked as DI token for me, until I decided to export it.

Expected behavior

Symbol can be used everywhere as DI token.

What is the motivation / use case for changing the behavior?

It would be very nice to use Symbol for token, because that's what token is ideological.

@soanvig
Copy link
Author

soanvig commented Oct 6, 2018

I misunderstood export. It does not export by dependcy token, but by provider as whole (so whole object with provide and useClass fields)

@soanvig soanvig closed this as completed Oct 6, 2018
@kamilmysliwiec kamilmysliwiec reopened this Oct 6, 2018
@kamilmysliwiec
Copy link
Member

It does not export by dependcy token, but by provider as whole

It should be compatible with just token as well (this approach is supported with strings for example). I'll take care of it, thanks for reporting!

@kamilmysliwiec
Copy link
Member

Fixed in 5.3.12

@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants