Skip to content

Instantly share code, notes, and snippets.

@dlhartveld
Last active December 13, 2015 18:49
Show Gist options
  • Save dlhartveld/4958127 to your computer and use it in GitHub Desktop.
Save dlhartveld/4958127 to your computer and use it in GitHub Desktop.
Simple example of an observable sequence of integers.
var xs = Observable.Range(1, 10)
.Select(x => x + 1)
.Where(x => x % 3 == 0);
xs.ObserveOn(Scheduler.Default).Subscribe(
el => Console.WriteLine("Got element: {0}", el),
ex => Console.WriteLine("Error: {0}", ex.Message),
() => Console.WriteLine("Completed.")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment