Skip to content

Instantly share code, notes, and snippets.

@darkyelox
Last active April 27, 2018 19:11
Show Gist options
  • Select an option

  • Save darkyelox/c4dee046605e07ad043225f38ad71105 to your computer and use it in GitHub Desktop.

Select an option

Save darkyelox/c4dee046605e07ad043225f38ad71105 to your computer and use it in GitHub Desktop.
Example of RxJS
Rx.Observable.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) // defines a stream of numbers
.map(num => num * 2) // multiply each number by two
.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