Skip to content

Instantly share code, notes, and snippets.

@nicowernli
Last active March 23, 2018 11:26
Show Gist options
  • Save nicowernli/b3eb1619f9d98e8625dbff259b3f52c0 to your computer and use it in GitHub Desktop.
Save nicowernli/b3eb1619f9d98e8625dbff259b3f52c0 to your computer and use it in GitHub Desktop.
Medium rxjs.map operator
const Rx = require('rxjs');
Rx.Observable.interval(1000)
.map(intervalValue => intervalValue * 2)
.subscribe(console.log); // 0, 2, 4, 6, 8, 10, 12, 14, 16, etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment