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(types): reactiveOmit and reactivePick support array as second arg #1742

Merged
merged 6 commits into from Jul 6, 2022

Conversation

Brain777777
Copy link
Contributor

Description

Fixed reactiveOmit and reactivePick parameter types not supporting passed arrays

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@antfu
Copy link
Member

antfu commented Jul 4, 2022

Can you provide the example you are trying to support with this?

@Brain777777
Copy link
Contributor Author

Can you provide the example you are trying to support with this?

After the modification

1656929414549

Before the change

1656929481689

@@ -8,7 +9,7 @@ import { reactiveComputed } from '../reactiveComputed'
*/
export function reactiveOmit<T extends object, K extends keyof T>(
obj: T,
...keys: K[]
...keys: Array<Many<K>>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
...keys: Array<Many<K>>
...keys: (K | K[])[]

The abstraction of Many make understanding it a bit harder. I think it's better to wrote them as literals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Yes the literal meaning is really easier to understand

@antfu antfu changed the title fix(shared): reactiveOmit And reactivePick Second parameter support Array fix(types): reactiveOmit and reactivePick support array as second arg Jul 6, 2022
@antfu antfu merged commit dd94d76 into vueuse:main Jul 6, 2022
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.

None yet

2 participants