This commit is contained in:
xixingwl
2023-02-04 08:50:14 +08:00
commit 98cfbb0b77
89 changed files with 9508 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
const PROMISE = Symbol('$$promise')
export default class Fetcher {
get [Symbol.toStringTag]() {
return '[object Fetcher]'
}
constructor() {
this[PROMISE] = new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
}
async source() {
return this[PROMISE]
}
async abort() {
;(await this.source())?.abort()
}
}