import ConcurrentAjax from './ConcurrentAjax'
let globalAjaxConf={
// 默认值为 get
method:'get',
headers:{},
params:{},
body:{},
// axiosHanle未设值 默认使用fetch
axiosHanle:null
}
let ins=new ConcurrentAjax(globalAjaxConf);
let ajaxList=new Array(9).fill({
url:'/path/example',
then:d=>console.log('data:',d),
catch:e=>console.log('err:',e),
// 不配置ajaxConf 默认使用globalAjaxConf中的配置
ajaxConf:{
method:'get',
headers:{},
params:{},
body:{},
axiosHanle:null
}
})
// 每次并发进行2个Ajax请求 直到耗尽ajaxList中所有的任务
ins.ConAjax(ajaxList,2)
###new ConcurrentAjax([globalAjaxConf])
Type: object
Ajax config.
Type: Array
ajax params List.
amount of ConcurrentAjax