Skip to content

Commit ffca0a6

Browse files
bloodyowlzth
authored andcommitted
Add doc example
1 parent 0f84f0b commit ffca0a6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Core__Array.resi

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
// TODO: Docs
2-
@val external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from"
1+
/**
2+
`fromIterator(iterator)`
3+
4+
Creates an array from the provided `iterator`
5+
6+
```res example
7+
let map = Map.fromArray([("foo", 1), ("bar", 2)])
8+
9+
Array.fromIterator(map->Map.values) // [1, 2]
10+
```
11+
*/
12+
@val
13+
external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from"
314

415
// TODO: Docs
516
@val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from"

0 commit comments

Comments
 (0)