mergeWith<O, R> method
- AsyncValue<
O> other, - MergeAsyncValueCallback<
R, T, O> combine
Merges this async value with another async value, combining their two values into one if both have data.
If both values have data, the combine function will be used to combine
both of them together. Both values need to have data for them to be
combined. If only one of them has a value, the resulting value will still
be a loading state.
Any errors will also appear in the resulting value's error. If only one value has an error, then the error will be included in the resulting async value. If both have errors, then a CombinedAsyncException will be returned in the resulting async value, with both errors present.
If only one of the given arguments has a value, or neither has a value, then the result will be a loading value.
Implementation
AsyncValue<R> mergeWith<O, R>(
AsyncValue<O> other,
MergeAsyncValueCallback<R, T, O> combine,
) =>
mergeAsyncValues(this, other, combine);