mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 05:48:17 +00:00
fix: polyfill Promise.allSettled
This commit is contained in:
parent
142aee55d2
commit
9ca4b3f92f
@ -19,10 +19,12 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ali/lowcode-datasource-types": "^1.0.21",
|
"@ali/lowcode-datasource-types": "^1.0.21",
|
||||||
"@ali/lowcode-types": "^1.0.20",
|
"@ali/lowcode-types": "^1.0.20",
|
||||||
|
"promise.allsettled": "^1.0.2",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^3.9.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ava/babel": "^1.0.1",
|
"@ava/babel": "^1.0.1",
|
||||||
|
"@types/promise.allsettled": "^1.0.3",
|
||||||
"@types/sinon": "^9.0.5",
|
"@types/sinon": "^9.0.5",
|
||||||
"ava": "3.11.1",
|
"ava": "3.11.1",
|
||||||
"get-port": "^5.1.1",
|
"get-port": "^5.1.1",
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
import { DataSourceMap, RuntimeDataSource, RuntimeDataSourceConfig } from '@ali/lowcode-types';
|
import { DataSourceMap, RuntimeDataSource, RuntimeDataSourceConfig } from '@ali/lowcode-types';
|
||||||
|
import allSettled from 'promise.allsettled';
|
||||||
|
|
||||||
|
// 兼容低版本的浏览器
|
||||||
|
const promiseSettled = typeof Promise.allSettled === 'function' ? Promise.allSettled : allSettled;
|
||||||
|
|
||||||
export const reloadDataSourceFactory = (
|
export const reloadDataSourceFactory = (
|
||||||
dataSource: RuntimeDataSource,
|
dataSource: RuntimeDataSource,
|
||||||
@ -56,7 +60,7 @@ export const reloadDataSourceFactory = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.allSettled(allAsyncLoadings);
|
await promiseSettled(allAsyncLoadings);
|
||||||
|
|
||||||
// 所有的初始化请求都结束之后,调用钩子函数
|
// 所有的初始化请求都结束之后,调用钩子函数
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user