Skip to content

Instantly share code, notes, and snippets.

@shrynx
Created January 14, 2017 08:51
Show Gist options
  • Save shrynx/cfe296e42e796dddaf41ee03e530d657 to your computer and use it in GitHub Desktop.
Save shrynx/cfe296e42e796dddaf41ee03e530d657 to your computer and use it in GitHub Desktop.
const time$ = Rx.Observable.interval(1000)
const filtered$ = time$
.filter(x => x%2 === 0)
.map(x => `${x} seconds have passed`)
filtered$.subscribe(x => console.log(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment