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

[useArrayMap] Allow output type different to input type #2159

Closed
4 tasks done
mandoway opened this issue Sep 2, 2022 · 0 comments · Fixed by #2172
Closed
4 tasks done

[useArrayMap] Allow output type different to input type #2159

mandoway opened this issue Sep 2, 2022 · 0 comments · Fixed by #2172
Labels
enhancement New feature or request

Comments

@mandoway
Copy link

mandoway commented Sep 2, 2022

Clear and concise description of the problem

As a dev using VueUse, I want to map an array to a different type so that I can map API result lists to another object.

The useArrayMap function currently limits the output type to be the same as the input type.
This does not reflect the behaviour of the native Array.map() function.

Suggested solution

In module shared/useArrayMap there should be a second generic argument to the function useArrayMap which is then used as the return type of the passed mapper function.

Alternative

No response

Additional context

No response

Validations

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

Successfully merging a pull request may close this issue.

1 participant