위젯 로드 전에 this.store.find Promise가 완료될 때까지 기다리는 방법

I am using a widget where its data is filled by obtainin some tag descriptions. I retrieve the descriptions as follows:

// tag_arr: variable containing an array of tag names.
tag_arr.forEach(tag => {
  this.store.find("tag-info", tag).then(result => {result.description //access tag description and do stuff.}
});

However, the descriptions won’t show up because the widget loads up before all iterations are completed. Is it possible to wait until this forEach actually finishes?

2개의 좋아요