Multi query adjustments (#1732)

This commit is contained in:
Jaco Greeff
2020-01-20 13:58:07 +01:00
committed by GitHub
parent f31bbdde02
commit eb5ee9860b
13 changed files with 98 additions and 140 deletions
@@ -62,10 +62,7 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a
const allIds = [...proposalIds, ...approvalIds];
return combineLatest([
// We are doing single subscriptions on all these, multi may yield old results
combineLatest(
allIds.map((id): Observable<Option<TreasuryProposal>> => api.query.treasury.proposals(id))
),
api.query.treasury.proposals.multi<Option<TreasuryProposal>>(allIds),
api.derive.council.proposals()
]).pipe(
map(([allProposals, councilProposals]: [Option<TreasuryProposal>[], DerivedCollectiveProposals]): DerivedTreasuryProposals =>