Skip to content

Commit 8a4d61a

Browse files
author
André Schreck
committed
documentation
1 parent 4577650 commit 8a4d61a

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,30 @@ No more elements are mapped or checked, because it is not necessary.
3333

3434
## Current Operators
3535

36-
* filter
37-
* map
38-
* flatMap
39-
* distinct
40-
* first
41-
* some
42-
* every
36+
### Intermetiate Operators
37+
38+
There can be as many intermediate operators as you want in a pipe. In an intermediate operator is the last operator of a pipe, the result of the pipe call will be an array.
39+
40+
* __filter__<br />
41+
Gets a function that takes an element and returns a boolean. The elements where the function returns true survive.
42+
* __map__<br />
43+
Gets a function and applies each element to that function.
44+
* __flatMap__
45+
The operator gets a function that maps to an array of elements and flattens them.
46+
* __distinct__
47+
Removes duplicated elements. It's important to not, that this is a statefull operator.
48+
49+
### Terminal Operators
50+
51+
A terminal operator has to be the last one in a pipe. Also, there can only be on terminal operator in a pipe.<br />
52+
If the terminal operator
53+
54+
* __first__<br />
55+
Gets a function that takes an element and returns a boolean. If an element is evaluated to true that element is immediately returned by the pipe.
56+
* __some__<br />
57+
Some works similar to the `first`-operator except that not the element is returned, but the value `true` as soon as the passed function evaluates to true.
58+
* __every__<br />
59+
`every` also applies the passed function to each element. As soon as one element does not evaluate to `true` the pipe immediately returns `false`.
4360

4461
## When is it usefull?
4562

0 commit comments

Comments
 (0)