await-timeout
await-timeout copied to clipboard
Supporting AbortController
It would also be nice to consider supporting AbortController which would allow the API to be web compatible (cancelling a timer and a fetch at the same time for instance):
const controller = new AbortController()
const timer = Timeout.set(1000, { signal: controller.signal });
signal.abort();
From https://github.com/vitalets/await-timeout/issues/3#issuecomment-496188927