mapValue<TR> method

QueryResult<TR> mapValue<TR>(
  1. ValueMapper<T, TR> mapper
)

map the value of query. If it is a SucceededResult, map its value with mapper. Otherwise, keep the result.

Implementation

QueryResult<TR> mapValue<TR>(ValueMapper<T, TR> mapper) =>
    map<QueryResult<TR>>(
      succeeded: (r) => QueryResult(mapper(r.value)),
      failed: (r) => QueryResult<TR>.failed(r.error, r.stackTrace),
    );