Skip to content

Commit 3c9ccf2

Browse files
committed
changelog + fix docstrings
1 parent eea5e0d commit 3c9ccf2

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Next version
44

5-
- Add `Iterator.forEach` and `AsyncIterator.forEach` helpers for iterators.
5+
- Add `Iterator.forEach` and `AsyncIterator.forEach` helpers for iterators https://github.com/rescript-association/rescript-core/pull/175
66
- Add `Dict.getUnsafe` https://github.com/rescript-association/rescript-core/pull/167
77

88
### Documentation

src/Core__AsyncIterator.resi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ See [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript
6565

6666
## Examples
6767
```rescript
68-
await someAsyncIterator->AsyncIterator.forEach(value => {
69-
if value > 10 {
70-
Console.log("More than 10!")
68+
await someAsyncIterator->AsyncIterator.forEach(value =>
69+
switch value {
70+
| Some(value) if value > 10 => Console.log("More than 10!")
71+
| _ => ()
7172
}
72-
})
73+
)
7374
```
7475
*/
7576
let forEach: (t<'a>, option<'a> => unit) => promise<unit>

src/Core__Iterator.resi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ See [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript
8686

8787
## Examples
8888
```rescript
89-
someIterator->Iterator.forEach(value => {
90-
if value > 10 {
91-
Console.log("More than 10!")
89+
someIterator->Iterator.forEach(value =>
90+
switch value {
91+
| Some(value) if value > 10 => Console.log("More than 10!")
92+
| _ => ()
9293
}
93-
})
94+
)
9495
```
9596
*/
9697
let forEach: (t<'a>, option<'a> => unit) => unit

0 commit comments

Comments
 (0)