Performs [].find() on an array but supports an async callback. The async callback is blocking. Meaning, awaitedFind will wait for a callback on array element 1 to finish before moving on to array element 2.
[].find()
awaitedFind
import {awaitedFind} from '@augment-vir/common';await awaitedFind( [ 1, 2, 3, 4, 5, ], async (value) => { await Promise.resolve(value > 2); },); Copy
import {awaitedFind} from '@augment-vir/common';await awaitedFind( [ 1, 2, 3, 4, 5, ], async (value) => { await Promise.resolve(value > 2); },);
@augment-vir/common
Performs
[].find()
on an array but supports an async callback. The async callback is blocking. Meaning,awaitedFind
will wait for a callback on array element 1 to finish before moving on to array element 2.