Performs [].filter() on an array but supports an async callback.
[].filter()
Optional
Each call to the filter callback is blocking, meaning the next one won't start until the current one finishes. By default this is false.
A new array (does not mutate).
import {awaitedFilter} from '@augment-vir/common';const result = await awaitedFilter( [ 1, 2, 3, 4, 5, ], async (value) => { return await Promise.resolve(value > 2); },); Copy
import {awaitedFilter} from '@augment-vir/common';const result = await awaitedFilter( [ 1, 2, 3, 4, 5, ], async (value) => { return await Promise.resolve(value > 2); },);
@augment-vir/common
Performs
[].filter()
on an array but supports an async callback.