LceStreamExtension<DATA extends Object> extension
LceState stream extensions
Methods
-
dataNoErrors(
) → Stream< DATA> -
Model's data stream with state information dropped.
No error events
DATA
Source model data type -
dataWithEmptyErrors(
) → Stream< DATA> -
Model's data stream with state information dropped.
Emits error event on upstream error state when upstream has no data
DATA
Source model data type -
dataWithErrors(
) → Stream< DATA> -
Model's data stream with state information dropped.
Emits error event on upstream error state
DATA
Source model data type -
errorIf(
bool predicate(LceError< DATA> error)) → Stream<LceState< DATA> > -
Emits error event when state is LceError and
predicate
returns true -
errorOnEmptyError(
) → Stream< LceState< DATA> > - Emits error on every LceError with empty data
-
errorOnError(
) → Stream< LceState< DATA> > - Emits error on every LceError
-
errorToLce(
[DATA? errorData(Object error)?]) → Stream< LceState< DATA> > -
Maps an upstream error to LceError
errorData
Evaluates data for error state -
flatMapSingleData<
DATA_2 extends Object> (Future< DATA_2> mapper(DATA data)) → Stream<LceState< DATA_2> > -
Maps each
DATA
to future forDATA_2
and merges back to LceState. If error occurs inmapper
emits LceError. Example: load someDATA_2
from server using originalDATA
as a parameter.DATA_2
Resulting data type mapper Data mapper -
getData(
[bool errorPredicate(LceError< DATA> error)?]) → Stream<DATA> -
Returns model's data stream dropping state information
DATA
Source model data typeerrorPredicate
A predicate to check error state. If predicate returns true, the stream emits error event -
onEmptyLoadingReturn(
LceState< DATA> block(LceLoading<DATA> loading)) → Stream<LceState< DATA> > -
Substitutes LceLoading with empty data with state produced by
block
block
transformation block -
onEmptyLoadingReturnData(
DATA block()) → Stream< LceState< DATA> > -
Substitutes LceLoading empty data with data produced by
block
block
Item creation block -
validData(
[bool errorPredicate(LceError< DATA> error)?]) → Stream<DATA> -
Model's valid data stream with state information dropped.
DATA
Source model data typeerrorPredicate
A predicate to check error state. If predicate returns true, the stream emits error event