摘要: 目前大部分的实现方式是利用 promise.race const fetchTimeOut = (timeout = 1000) => { return new Promise((resolve, reject) => { setTimeOut(() => { reject('fetch timeO 阅读全文
posted @ 2023-06-13 16:01 10后程序员劝退师 阅读(929) 评论(0) 推荐(0)
摘要: 函数重载 将函数接收到的不同参数,进行不同处理。 import createOverLoad from './funReload.js' const getUsers = createOverLoad() getUsers.addImpl(() => { console.log('查询所有用户') 阅读全文
posted @ 2023-06-13 14:01 10后程序员劝退师 阅读(39) 评论(0) 推荐(0)