Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/async-array-utils. A collection of array-related async utilities.
array array-methods async promise utils
Something went wrong. Try again.
374 B · 16 lines
JavaScript
at yarn-2
1234567891011121314151617import asyncForEach from './forEach';
export default async function asyncSome(arr, fn) { return new Promise((resolve) => { // eslint-disable-next-line no-shadow asyncForEach(arr, async (cur, idx, arr) => { const result = await fn(cur, idx, arr);
if (!result) { resolve(false); } }).then(() => { resolve(true); }); });}