1 2 3 4 5 ··· 28 下一页
摘要: /* * WorkBus.js — Promise 通信总线(ES6 模块,Node / 浏览器双端) * * 通信模式:resolve / waitEnd(Promise 握手) * - WorkBus.resolve(event, payload) 发布(解决)事件:缓存最后 payload,唤 阅读全文
posted @ 2026-10-23 10:38 无工时代 阅读(3) 评论(0) 推荐(0)
摘要: /* * 缓存并发接口函数,解决重复请求和并发请求问题 * id:唯一值 * cacheSecond:缓存时间,单位秒 * syncFunc:加载函数 * cacheMode:缓存模式,'default' 过期后重新拉取;'stale' 过期先用旧缓存返回、后台刷新(默认 'default') */ 阅读全文
posted @ 2026-10-23 10:10 无工时代 阅读(3) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2026-09-17 15:03 无工时代 阅读(6) 评论(0) 推荐(0)
摘要: function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } const dateFormat = function (date, fmt) { if (!date) return '' date = n 阅读全文
posted @ 2025-05-09 16:45 无工时代 阅读(30) 评论(0) 推荐(0)
摘要: // 定义 bigRect 的尺寸 function range(min, max, step = 1) { const arr = []; for (let i = min; i <= max; i += step) { arr.push(i); } return arr; } const big 阅读全文
posted @ 2025-05-01 22:11 无工时代 阅读(41) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2024-12-25 11:34 无工时代 阅读(22) 评论(0) 推荐(0)
摘要: module.exports = { JSONToPathArr(data){ const resArr=[] const pArr=[''] const list=[data] for(let i=0;i<list.length;i++){ const json=list[i] for(let k 阅读全文
posted @ 2024-12-13 16:26 无工时代 阅读(47) 评论(0) 推荐(0)
摘要: const fs=require('fs') const path=require('path') const list=fs.readdirSync(__dirname) const objList=[] list.forEach(function (name){ if(name.indexOf( 阅读全文
posted @ 2024-11-21 14:47 无工时代 阅读(40) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-09-07 15:35 无工时代 阅读(1) 评论(0) 推荐(0)
摘要: 分为前端版本和服务器版本 /* 缓存并发接口函数,解决重复请求和并发请求问题 id:唯一值 cacheSecond:缓存时间,单位秒 syncFunc:加载函数 */ const _map = {} const _startTimeMap = {} const _idArr=[] const _re 阅读全文
posted @ 2024-08-27 00:12 无工时代 阅读(51) 评论(0) 推荐(0)
1 2 3 4 5 ··· 28 下一页