/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="source"></param> /// <param name="bag"></param> public static void DisposeBag <T>(this IObservable <T> source, DisposeBag bag) { var token = source.Subscribe(observer => { }); bag.Collect(token); }
// TODO: Convert to catamophism || isomorphism public static void DisposeBag <T>(this IObservable <T> source, DisposeBag bag) { var token = source.Subscribe(); // usually take this at the end of stream composition bag.Collect(token); }