rxFuture<T> method

RxFuture<T> rxFuture<T>(
  1. Future<T> loader(), {
  2. bool immediate = true,
  3. bool isEmpty(
    1. T data
    )?,
})
inherited

Creates an RxFuture scoped to this controller (Loading -> Success / Empty / Error with stale-while-revalidate and race cancellation) and automatically disposes it in onClose.

Implementation

RxFuture<T> rxFuture<T>(
  Future<T> Function() loader, {
  bool immediate = true,
  bool Function(T data)? isEmpty,
}) {
  final resource = RxFuture<T>(
    loader,
    immediate: immediate,
    isEmpty: isEmpty,
  );
  _syncDisposers.add(resource.close);
  return resource;
}