public static ReplaySubject <T> Broadcast <T> (Action <T> lambda) { var broadcast = new ReplaySubject <T>(); broadcast.ForEachAsync(lambda); return(broadcast); }
public static void Broadcast <T>(IObservable <T> recievers, Action <T> lambda) { var broadcast = new ReplaySubject <T>(); broadcast.ForEachAsync(lambda); recievers.Subscribe(cl => broadcast.OnNext(cl), () => broadcast.OnCompleted()); broadcast.Dispose(); }