提交 aaf4560e 编写于 作者: I isidor

async: ignoreErorrs

上级 2a8f7c53
...@@ -346,6 +346,10 @@ export function always<T>(promise: Thenable<T>, callback: () => void): Promise<T ...@@ -346,6 +346,10 @@ export function always<T>(promise: Thenable<T>, callback: () => void): Promise<T
return Promise.resolve(promise); return Promise.resolve(promise);
} }
export function ignoreErrors<T>(promise: Thenable<T>): Thenable<T | undefined> {
return promise.then(undefined, _ => undefined);
}
/** /**
* Runs the provided list of promise factories in sequential order. The returned * Runs the provided list of promise factories in sequential order. The returned
* promise will complete to an array of results from each promise. * promise will complete to an array of results from each promise.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册