Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Rx - Aggregate vs. Scan

AddThis Social Bookmark Button
Rx - Aggregate vs. Scan this post will focus on 2 Rx operators Aggregate and Scan. both Aggregate and Scan are dealing with event stream accumulation, the only difference is that Aggregate produce single result (upon the stream completion)
and Scan present an ongoing runtime accumulation which react for each OnNext. both operators has 2 overloads with the same signature:
Code Snippet
IObservable Aggregate(     this IObservable source,     Func accumulator);   IObservable Scan(     this IObservable source,     Func accumulator);  
IObservable Aggregate(     this IObservable source,     TAccumulate seed,     Func accumulator);   IObservable Scan(     this IObservable source,     TAccumulate seed,     Func accumulator);
the first overload (line 1,5) gets a simple accumulation Func which get the previous accumulated value and the current value as parameters and should return new accumulated value (on the first accumulation the previous accumulated value will be default(T)). the second overload define a seed value for the first accumulation and a Func which get the previous accumulated value and the current value as parameters...(Read whole news on source site)

Home : Blog List : [Export] Bnaya Eshet : Rx - Aggregate vs. Scan