Skip to content

Commit

Permalink
Add toArray documentation (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag authored and kelunik committed Oct 11, 2019
1 parent 5a294f1 commit ad31ed8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/iterators/transformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ layout: docs
title: Iterator Transformation
permalink: /iterators/transformation
---
Amp provides two common transformation helpers for iterators: `map` and `filter`.
Amp provides some common transformation helpers for iterators: `map`, `filter` and `toArray`.

Further primitives are very easy to implement using `Producer` with those two as examples.
Further primitives are very easy to implement using `Producer` with these as examples.

## `map()`

Expand All @@ -14,3 +14,7 @@ Further primitives are very easy to implement using `Producer` with those two as
## `filter()`

`filter()` accepts an `Iterator` and a `callable` `$filter`. If `$filter($value)` returns `false` the value gets filtered, otherwise the value is retained in the resulting `Iterator`.

## `toArray()`

`toArray()` accepts an `Iterator` and returns a `Promise` which resolves to an array of all the items from the iterator.

0 comments on commit ad31ed8

Please sign in to comment.