windowFuture<O> method

Observable<Stream<T>> windowFuture <O>(Future<O> onFutureHandler())

Creates an Observable where each item is a Stream containing the items from the source sequence, batched whenever onFutureHandler completes.


new Observable.periodic(const Duration(milliseconds: 100), (int i) => i)
  .windowFuture(() => new Future.delayed(const Duration(milliseconds: 220)))
  .doOnData((_) => print('next window'))
  .flatMap((s) => s)
  .listen(print); // prints next window 0, 1, next window 2, 3, ...


Observable<Stream<T>> windowFuture<O>(Future<O> onFutureHandler()) =>
    transform(new WindowStreamTransformer<T>(onFuture(onFutureHandler)));