Skip to content

Commit 81c0dc6

Browse files
committed
Improve asyncSomeStrict example to include side effect
1 parent b640eba commit 81c0dc6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,15 @@ Like `asyncSome()`, but runs iterations non-concurrently.
146146
```js
147147
import { asyncSomeStrict } from '@wojtekmaj/async-array-utils';
148148

149-
const largerThanZero = await asyncSomeStrict([1, 2, 3], async (el, index) => el > 0); // true
149+
const indexes = [];
150+
const largerThanZero = await asyncSomeStrict(
151+
[1, 2, 3],
152+
async (el, index) => {
153+
indexes.push(index);
154+
return el > 0;
155+
},
156+
); // true
157+
console.log(indexes); // [0, 1, 2]
150158
```
151159

152160
## License

0 commit comments

Comments
 (0)