Skip to content

Improve typing of predicate param to function WrapperArray<>.filter(predicate) #1068

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

Closed
ascott18 opened this issue Dec 13, 2018 · 0 comments
Closed

Comments

@ascott18
Copy link

What problem does this feature solve?

WrapperArray.filter is currently typed as filter (predicate: Function): WrapperArray<Vue>. The type of predicate should be more specific.

What does the proposed API look like?

filter (predicate: (value: Wrapper<V>, index: number, array: Wrapper<V>[]) => value is Wrapper<V>): WrapperArray<Vue>

This is the same signature as Array.filter since WrapperArray.filter passes the predicate down to Array.filter.

@ascott18 ascott18 changed the title Improve typeing of predicate param to function WrapperArray<>.filter(predicate) Improve typing of predicate param to function WrapperArray<>.filter(predicate) Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants