types: simplify types (#104)

This commit is contained in:
月迷津渡
2019-10-05 22:09:34 +08:00
committed by Evan You
parent ca70aff860
commit 9d6783053c
12 changed files with 50 additions and 71 deletions

View File

@@ -72,7 +72,7 @@ export function callWithAsyncErrorHandling(
) {
const res = callWithErrorHandling(fn, instance, type, args)
if (res != null && !res._isVue && typeof res.then === 'function') {
;(res as Promise<any>).catch(err => {
res.catch((err: any) => {
handleError(err, instance, type)
})
}