11 2020 档案

摘要:/* 缓存加载函数 cacheLen:最多缓存多少个接口 id:唯一值 name:方法名 syncFunc:加载函数 */ // 缓存最近的20个接口 const methodCacheArr = [] let cacheLen = 20 try { const arr=JSON.parse(loc 阅读全文
posted @ 2020-11-18 16:07 无工时代 阅读(123) 评论(0) 推荐(0) 编辑
摘要:/* 并发加载函数 id:唯一值 syncFunc:加载函数 */ const _map={} async function conCurentLoad (id,syncFunc) { //兼容并发加载的情况 if(!_map[id]){ _map[id]=[]; const res = await 阅读全文
posted @ 2020-11-13 19:20 无工时代 阅读(130) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示