Last active
April 27, 2018 19:11
-
-
Save darkyelox/99437adb9aa61c6f4f0f3757f8f49a20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rx.Observable.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) // defines a stream of numbers | |
| .filter(num => num % 2 == 0) // filter by pair numbers | |
| .map(num => num * 2) // multiply each number by two | |
| .takeLast(3) // take only the last 3 number of the stream | |
| .map(num => `i'm the number ${num}`) // convert each number to an string | |
| .subscribe(num => console.log(num)) // subscribes and prints each number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment