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

Type Alias: LifecycleUndo ​

LifecycleUndo = (signal) => unknown

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

The function a lifecycle hook may return: it undoes the hook when the app stops. It receives the signal passed to running.stop(), aborted when stopping takes too long.

Parameters ​

signal ​

LifecycleSignal

Returns ​

unknown

Example ​

ts
const close: LifecycleUndo = (signal) => server.close({ force: signal.aborted });

Released under the MIT License.