mapValue<TR> method
map the value of query.
If it is a SucceededResult or InitialValueResult, map its value with mapper
.
Otherwise, keep the result.
Implementation
AsyncQueryResult<TR> mapValue<TR>(
ValueMapper<T, TR> mapper,
) =>
mapOr(
succeeded: (r) => AsyncQueryResult.succeeded(mapper(r.value)),
initialValue: (r) => AsyncQueryResult.initialValue(mapper(r.value)),
failed: (r) => AsyncQueryResult.failed(r.error, r.stackTrace),
orElse: () => this as AsyncQueryResult<TR>,
);