whereNotNull method

RxComputed<T?> whereNotNull()

Filter out null values, retaining the last non-null value when source becomes null.

Implementation

RxComputed<T?> whereNotNull() {
  T? lastNonNull;
  return computed(() {
    final current = value;
    if (current != null) {
      lastNonNull = current;
    }
    return lastNonNull;
  });
}