@reactivex/ix-esnext-esm
Version:
The Interactive Extensions for JavaScript
14 lines (12 loc) • 351 B
JavaScript
import { bindCallback } from '../util/bindcallback';
export async function find(source, predicate, thisArg) {
const fn = bindCallback(predicate, thisArg, 2);
let i = 0;
for await (const item of source) {
if (await fn(item, i++)) {
return item;
}
}
return undefined;
}
//# sourceMappingURL=find.mjs.map