Rx: Materialize() – Stream Notifcations
Jeffery’s posting offer some insight in to what you can do with Materialize(). Using the Materialize() I can inspect the stream and handle any error without having to pass an Action though the various layer within an application:
public static IObservable CheckForErrorInStream(this IObservable source, Action action)
{
return source.Materialize().Select(n =>
{
if (n.Kind == NotificationKind.OnError)
{
var error = (Notification.OnError) n;
action(error.Exception);
}
return n;
}).Dematerialize();
}
Awesome Article. Hope to read more from you!
Trish Koziak said this on January 20, 2016 at 9:26 pm |