12345678910111213141516171819202122 |
- let pendingList = []
- export class PendingManager {
- constructor() {
- this.isRefreshing = false
- }
- /**
- * 添加一个请求到等待队列中
- */
- addPending(callback) {
- pendingList.push(callback)
- }
- /**
- * 执行等待中的所有请求,清空队列
- */
- removeAllPending() {
- pendingList.forEach((callback) => callback())
- pendingList = []
- }
- }
|