Skip to content

Commit 6248fb0

Browse files
committed
changelog + fix docstrings
1 parent 5ab144e commit 6248fb0

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
@@ -8,7 +8,7 @@
88
- Remove internal xxxU helper functions that are not needed anymore in uncurried mode. https://github.com/rescript-association/rescript-core/pull/191
99
- Rename `Object.empty` to `Object.make` for consistency.
1010
- Add dynamic `import`. https://github.com/rescript-association/rescript-core/pull/178
11-
- Add `Iterator.forEach` and `AsyncIterator.forEach` helpers for iterators.
11+
- Add `Iterator.forEach` and `AsyncIterator.forEach` helpers for iterators. https://github.com/rescript-association/rescript-core/pull/175
1212

1313
## 1.0.0
1414

src/Core__AsyncIterator.resi

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

6767
## Examples
6868
```rescript
69-
await someAsyncIterator->AsyncIterator.forEach(value => {
70-
if value > 10 {
71-
Console.log("More than 10!")
69+
await someAsyncIterator->AsyncIterator.forEach(value =>
70+
switch value {
71+
| Some(value) if value > 10 => Console.log("More than 10!")
72+
| _ => ()
7273
}
73-
})
74+
)
7475
```
7576
*/
7677
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
@@ -87,11 +87,12 @@ See [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript
8787

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

0 commit comments

Comments
 (0)