forked from pinks/eris
1
0
Fork 0
eris/common/deadline.ts

6 lines
180 B
TypeScript
Raw Normal View History

2023-09-22 02:59:22 +00:00
export function deadline(timeout: number): AbortSignal {
const controller = new AbortController();
setTimeout(() => controller.abort(), timeout);
return controller.signal;
}