Documents injecute 1.x · Migrating from 0.x
Skip to content

Type Alias: LifecycleSignal ​

LifecycleSignal = typeof globalThis extends object ? S : AbortSignalLike

Defined in: src/utils/lifecycle.ts:54

The signal an undo function receives: the global AbortSignal when your environment's types have one (DOM or Node.js), otherwise AbortSignalLike.

Example ​

ts
app.addSingleton(lifecycle.start('server'), (server) => {
  server.listen(8080);
  return (signal: LifecycleSignal) => server.close({ force: signal.aborted });
}, ['server']);

Released under the MIT License.