onEmptyLoadingReturnData method

Stream<LceState<DATA>> onEmptyLoadingReturnData(
  1. DATA block()
)

Substitutes LceLoading empty data with data produced by block block Item creation block

Implementation

Stream<LceState<DATA>> onEmptyLoadingReturnData(DATA Function() block) => map((state) =>
  state.whenElse(
      loading: (loading) => null == loading.data ? LceState.loading(block(), loading.dataIsValid, loading.type) : loading,
      onElse: (state) => state
  )
);