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

types(inject): allow inject key to be number #2975

Closed
wants to merge 1 commit into from
Closed

types(inject): allow inject key to be number #2975

wants to merge 1 commit into from

Conversation

yangmingshan
Copy link
Contributor

#2616 add number type to provide key, so should inject key.

@posva posva added the 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. label Jan 11, 2021
@posva
Copy link
Member

posva commented Jan 11, 2021

This looks good but I wonder if it makes sense to allow numbers at all for keys with inject/provide

@yangmingshan
Copy link
Contributor Author

yangmingshan commented Jan 20, 2021

@yangmingshan
Copy link
Contributor Author

@posva Can we move this PR forward?

@posva
Copy link
Member

posva commented Feb 7, 2021

I'm not sure we should allow injecting numerical keys because they are very likely to collision and hard to debug. So overall a bad practice that is better not to be supported.
Like you said, the number was added to inject to make it pass typings but I wonder if we shouldn't even remove that instead

@yangmingshan
Copy link
Contributor Author

I agree, I'm closing this, and open #3196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants