Skip to content

Instantly share code, notes, and snippets.

@GerritRiesch94
Created March 3, 2022 08:19
Show Gist options
  • Save GerritRiesch94/b3377e76d77f3dcbb3e3b51d7269d078 to your computer and use it in GitHub Desktop.
Save GerritRiesch94/b3377e76d77f3dcbb3e3b51d7269d078 to your computer and use it in GitHub Desktop.
SimpleRxJSFilterChain
import { of } from 'rxjs';
import { filter} from 'rxjs/operators';
of(0815, 4711, 99, 98)
.pipe(filter((precinctNumber) => precinctNumber === 99))
.subscribe((value) => console.log(`The coolest precinct: ${value}`));
// Logs:
// The coolest precinct: 99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment