Skip to content

Commit

Permalink
don't use map, just simple loop
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <jakub@status.im>
  • Loading branch information
jakubgs committed Dec 12, 2019
1 parent 60f14bb commit ccae507
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ class DiscoverService extends BlockchainService {
JSON.stringify(await MetadataClient.retrieveMetadataCache()),
)

let asyncCalls = [...Array(contractDappsCount).keys()].map(
i => DiscoverContract.methods.dapps(i).call({ from: this.sharedContext.account })
)
let asyncCalls = [ ]
for (let i = 0; i < contractDappsCount; i++) {
asyncCalls.push(
DiscoverContract.methods.dapps(i).call({from: this.sharedContext.account})
)
}
/* using Promise.all() to run calls in parallel */
let dapps = await Promise.all(asyncCalls)

Expand Down

0 comments on commit ccae507

Please sign in to comment.