确定promise返回类型

结构:
new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise;

可行方案:

  1. new Promise(resolve, reject);
  2. new Promise(resolve(classType)=>void, reject);

两种写法根据结构来讲实现都一样,不会对reject进行变动

你可能感兴趣的:(确定promise返回类型)