validData method

Stream<DATA> validData([
  1. bool errorPredicate(
    1. LceError<DATA> error
    )?
])

Model's valid data stream with state information dropped. DATA Source model data type errorPredicate A predicate to check error state. If predicate returns true, the stream emits error event

Implementation

Stream<DATA> validData([bool Function(LceError<DATA> error)? errorPredicate]) => errorIf(errorPredicate ?? (_) => true)
    .where((state) => null != state.data && state.dataIsValid)
    .map((state) => state.data!)
    .distinct();