mapContent<Z> method

Stream<LoadingState<Z>> mapContent<Z>(
  1. Z transform(
    1. A content
    )
)

Implementation

Stream<LoadingState<Z>> mapContent<Z>(Z Function(A content) transform) {
  return map((event) {
    return event.when(
      loading: (content) => LoadingState.loading((content != null) ? transform(content) : null),
      completed: (content, next, prev) => LoadingState.completed(transform(content), next, prev),
      error: (exception) => LoadingState.error(exception),
    );
  });
}