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

fix(provide): support symbols in applyOptions #2616

Merged
merged 1 commit into from
Nov 30, 2020
Merged

fix(provide): support symbols in applyOptions #2616

merged 1 commit into from
Nov 30, 2020

Conversation

privatenumber
Copy link
Contributor

Fixes #2615

@@ -5,7 +5,7 @@ import { warn } from './warning'

export interface InjectionKey<T> extends Symbol {}

export function provide<T>(key: InjectionKey<T> | string, value: T) {
export function provide<T>(key: InjectionKey<T> | string | number, value: T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@privatenumber @yyx990803 Why | number is added

Copy link
Contributor Author

@privatenumber privatenumber Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back when this was written, Reflect.ownKeys() returned PropertyKey[], which includes the number type.

Now that Reflect.ownKeys() has been updated to return string | symbol, the number type can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component API provide doesn't support symbols
4 participants