Combining results topic

Combine several query results into one: (a, b).combine(...) over a record of results, combine over a list, optional() for sources a combination can do without, and CombineMemo to keep the combined value stable.

Classes

CombinedData<T> Combining results
Every source has data; data is what the combiner made of it.
CombinedError<T> Combining results
A source failed and has no data to fall back on. retry() refetches the failed sources.
CombinedPending<T> Combining results
At least one source has nothing to show yet, and none has failed outright.
CombinedResult<T> Combining results
What several QueryResults amount to together: nothing to show yet (CombinedPending), a source that failed with nothing to show (CombinedError), or every source's data run through the combiner (CombinedData).
CombineMemo<T> Combining results
Remembers the last combination, so a combiner runs only when a source's data really changed and an equal result keeps its instance.

Extensions

CombineQueryResultList on List<QueryResult<T>> Combining results
combine over a list of results of one type — a QueriesObserver's results, say, one per item of a dynamic list — by the same rules as a record of them, and combineWith for that list plus one more source of another type.
CombineQueryResults2 on (QueryResult<A>, QueryResult<B>) Combining results
combine over a record of two results: runs the combiner once both have data, by the rules on CombinedResult.
CombineQueryResults3 on (QueryResult<A>, QueryResult<B>, QueryResult<C>) Combining results
combine over a record of three results: runs the combiner once all three have data, by the rules on CombinedResult.
CombineQueryResults4 on (QueryResult<A>, QueryResult<B>, QueryResult<C>, QueryResult<D>) Combining results
combine over a record of four results: runs the combiner once all four have data, by the rules on CombinedResult.
CombineQueryResults5 on (QueryResult<A>, QueryResult<B>, QueryResult<C>, QueryResult<D>, QueryResult<E>) Combining results
combine over a record of five results: runs the combiner once all five have data, by the rules on CombinedResult.
CombineQueryResults6 on (QueryResult<A>, QueryResult<B>, QueryResult<C>, QueryResult<D>, QueryResult<E>, QueryResult<F>) Combining results
combine over a record of six results: runs the combiner once all six have data, by the rules on CombinedResult. Past six, combine a list of what the sources have in common — <QueryResult<Object?>>[...] at worst — and cast in the combiner; a CombinedResult is not a source, so two combinations cannot be combined.
OptionalQueryResult on QueryResult<T> Combining results
Marks a source a combination can do without — see optional.