@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 findIndex(source, predicate, thisArg) {
const fn = bindCallback(predicate, thisArg, 2);
let i = 0;
for await (const item of source) {
if (await fn(item, i++)) {
return i;
}
}
return -1;
}
//# sourceMappingURL=findindex.mjs.map