An AbortSignal that fires on a resetable timeout
npm install retimeable-signal

> An AbortSignal that fires on a resetable timeout
This module exports a retimeableSignal function that returns anAbortSignal that fires an "abort" event after a specified number of ms.
It has been augmented with two additional methods reset and clear which
change the timeout time and prevent it from firing entirely.
``TypeScript
import { retimeableSignal } from 'retimeable-signal'
const signal = retimeableSignal(100)
//... time passes, reset timeout to now + 100ms
signal.reset(100)
// stop the signal from aborting at all
signal.clear()
`
This is module is inspired by the retimer
module except that uses setTimeout which can cause a Node.js process toAbortSignal.timeout
stay open, this uses which does not.
`console`
$ npm i retimeable-signal
-
Licensed under either of
- Apache 2.0, (LICENSE-APACHE /
- MIT (LICENSE-MIT /
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.