Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 2x 2x 2x 265x 265x 210x 2x 464x 2x 309x 2x 48x | export { generateRequestHash } from "./utils"
const pendingRequest: Record<string, any> = {}
export function addPendingRequest(hash: string, request: Promise<any>, timeout: number) {
pendingRequest[hash] = request
setTimeout(() => {
clearPendingRequest(hash)
}, timeout)
}
export function clearPendingRequest(hash: string) {
Reflect.deleteProperty(pendingRequest, hash)
}
export function checkIfHasPendingRequest(hashKey: string): boolean {
return Reflect.has(pendingRequest, hashKey)
}
export function getCachedRequest(hashKey: string) {
return pendingRequest[hashKey]
}
|