Skip to content

Instantly share code, notes, and snippets.

@jennings
Last active December 19, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jennings/c39374a9826532bfae1bae8e0ba76b4b to your computer and use it in GitHub Desktop.
Save jennings/c39374a9826532bfae1bae8e0ba76b4b to your computer and use it in GitHub Desktop.
A cheatsheet of Rx.NET to rxjs operators

Creation

System.Reactive rxjs 6
Observable.Return import { of } from "rxjs"
Observable.Empty import { EMPTY } from "rxjs"
Observable.Never import { NEVER } from "rxjs"
Observable.Throw import { throwError } from "rxjs"
Observable.Create new Observable(observer => {})
Observable.Range import { range } from "rxjs"
Observable.Generate import { generate } from "rxjs"
Observable.Interval import { interval } from "rxjs"
Observable.Timer import { timer } from "rxjs"

Reduction

System.Reactive rxjs 6
.Where import { filter } from "rxjs/operators"
.Distinct import { distinct } from "rxjs/operators"
.DistinctUntilChanged import { distinctUntilChanged, distinctUntilKeyChanged } from "rxjs/operators"
.IgnoreElements import { ignoreElements } from "rxjs/operators"
.Skip, .Take import { skip, take } from "rxjs/operators"
.SkipWhile, .TakeWhile import { } from "rxjs/operators"
.SkipLast, .TakeLast import { skipLast } from "rxjs/operators"
.SkipUntil, .TakeUntil import { skipUntil } from "rxjs/operators"

Inspection

System.Reactive rxjs 6
.Any
.All
.Contains
.DefaultIfEmpty
.ElementAt
.SequenceEqual

Aggregation

System.Reactive rxjs 6
.Count
.Min
.Max
.Sum
.Average
.First
.Last
.Single
.Aggregate
.Scan
.MinBy, .MaxBy
.GroupBy

Combining sequences

System.Reactive rxjs 6
.Switch import { switchAll } from "rxjs/operators"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment