Closed saghul closed 1 month ago
Replace the current signal API with one following a similar model to EventTarget, a la Deno.
Before
const sh = tjs.signal('SIGINT', handleSigInt); // sh needs to be alive or the signal handler is destroyed.
After
tjs.addSignalListener('SIGINT', handleSigInt); // No need to use a handle, it can be removed with // tjs.removeSignalListener.
Fixes: https://github.com/saghul/txiki.js/issues/476 Ref: https://github.com/saghul/txiki.js/issues/477
Replace the current signal API with one following a similar model to EventTarget, a la Deno.
Before
After
Fixes: https://github.com/saghul/txiki.js/issues/476 Ref: https://github.com/saghul/txiki.js/issues/477