public static void PrintEvens() { var ints = new AllIntsStream(); var evens = ints.Where(i => i % 2 == 0); evens.Subscribe(i => Console.WriteLine(i)); }
public static void PrintSquaredEvens() { var ints = new AllIntsStream(); var evensSquared = ints.Where(i => i % 2 == 0) .Select(i => i * i); evensSquared.Subscribe(i => Console.WriteLine(i)); }
public static void ForComparison() { var xs = new AllIntsStream(); var ys = xs.Where(x => cond(x)) .Select(x => f(x)) .Where(y => cond2(y)); ys.Subscribe(y => Console.WriteLine(y)); }
public static void PrintEvens() { var ints = new AllIntsStream(); var evens = ints.Where(i => i % 2 == 0); evens.DataAvailable += i => Console.WriteLine(i); ints.Start(); }