File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Next version
4
4
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
6
6
- Add ` Dict.getUnsafe ` https://github.com/rescript-association/rescript-core/pull/167
7
7
8
8
### Documentation
Original file line number Diff line number Diff line change @@ -65,11 +65,12 @@ See [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript
65
65
66
66
## Examples
67
67
```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
+ | _ => ()
71
72
}
72
- } )
73
+ )
73
74
```
74
75
*/
75
76
let forEach: (t<'a>, option<'a> => unit) => promise<unit>
Original file line number Diff line number Diff line change @@ -86,11 +86,12 @@ See [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript
86
86
87
87
## Examples
88
88
```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
+ | _ => ()
92
93
}
93
- } )
94
+ )
94
95
```
95
96
*/
96
97
let forEach: (t<'a>, option<'a> => unit) => unit
You can’t perform that action at this time.
0 commit comments