use Promise.all for concurrency

This commit is contained in:
zhangenming
2021-09-05 16:27:15 +08:00
committed by 神戸小鳥
parent d86f2330d5
commit 1cf073bc51

View File

@ -15,10 +15,11 @@ class Life {
#triggerTalents;
async initial() {
const age = await json('age');
const talents = await json('talents');
const events = await json('events');
const [age, talents, events] = await Promise.all([
json('age'),
json('talents'),
json('events'),
])
this.#property.initial({age});
this.#talent.initial({talents});
this.#event.initial({events});