onEmptyLoadingReturn method

Stream<LceState<DATA>> onEmptyLoadingReturn(
  1. LceState<DATA> block(
    1. LceLoading<DATA> loading
    )
)

Substitutes LceLoading with empty data with state produced by block block transformation block

Implementation

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