I have a list of community’s ID, which I want to get a data (e.g. avatarFileID, displayName, …)
Nowadays, I’m using communityForId with a map to get the data. After that, I use the result to show on screen. I’ve code like this.
this.recommendCommunities.map(community => {
const recommendCommunity = CommunityRepository.communityForId(community.id)
recommendCommunity.on('dataUpdated', data => {
const text = data.displayName
const filterCommunity = { id: community.id, text: text, image: data.avatarFileId }
this.recommendCommunitiesWithImage.push(filterCommunity)
})
})
It takes a while to get all the data one by one, and sometimes the screen shows up before all the data was complete.
So, does any function would helps to get all the data at once?