我想做一个反应式扩展窗口操作符,它:
这样就不会产生重叠,而是允许出现间隙。
到目前为止我还没有成功。有人知道怎么做吗?
GroupByUntil似乎能做到这一点:
public static IObservable<IObservable<T>> LazyWindow<T, TClosing>( this IObservable<T> source, Func<IObservable<TClosing>> windowClose) => source .GroupByUntil(x => 0, group => windowClose()) .Select(x => (IObservable<T>) x);
编辑:不要使用 null 作为常量组密钥,它在框架内产生了NRE。很奇怪。
null