21 lines
545 B
TypeScript
21 lines
545 B
TypeScript
let auctionTimer = new Map<string, NodeJS.Timer>();
|
|
|
|
export function getLotTimer(code: string) {
|
|
return auctionTimer.get(code)
|
|
}
|
|
|
|
export function setLotTimer(code: string, timer: NodeJS.Timer) {
|
|
if(auctionTimer.has(code)) {
|
|
let originTimer = auctionTimer.get(code);
|
|
if(originTimer) clearTimeout(originTimer);
|
|
}
|
|
auctionTimer.set(code, timer);
|
|
}
|
|
|
|
export function clearLotTimer(code: string) {
|
|
let timer = getLotTimer(code);
|
|
if (timer) {
|
|
clearTimeout(timer);
|
|
auctionTimer.delete(code)
|
|
}
|
|
} |