We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FR: Would be great to have filterAsync and mapSync for arrays that work with Promise predicates.
Example (taken from internet):
async function mapAsync<T, U>(array: T[], callbackfn: (value: T, index: number, array: T[]) => Promise<U>): Promise<U[]> { return Promise.all(array.map(callbackfn)) } async function filterAsync<T>(array: T[], callbackfn: (value: T, index: number, array: T[]) => Promise<boolean>): Promise<T[]> { const filterMap = await mapAsync(array, callbackfn) return array.filter((_, index) => filterMap[index]) }
The text was updated successfully, but these errors were encountered:
I'll think about it, looks like such a change can lead to whole ArrayLike interface realisation with Promise result.
ArrayLike
Sorry, something went wrong.
netknight
No branches or pull requests
FR: Would be great to have filterAsync and mapSync for arrays that work with Promise predicates.
Example (taken from internet):
The text was updated successfully, but these errors were encountered: