我有几个类被激发,它们的“fireScript”方法,在一个promise方法中。全部的我不知道当一个类在地图上移动时,我会如何注释它。
import ShoeClass from 'products/ShoeClass';
import HatClass from 'products/HatClass';
//somewhere else the code
await promise.all([ShoeClass, HatClass]
.map(product => product.firScript()))
这给了我错误,所以我试图为一个类找到一个泛型流类型,这可能吗?
.map(product <---- this wants an annotation. Each mapped class is different obviously, but how would I annotate it? With a generic?