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

Type Alias: Lifecycle<S> ​

Lifecycle<S> = { readonly [P in S]: Tag<LifecycleHook, P> }

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

Lifecycle stages, made by createLifecycle: one Tag of LifecycleHook per stage. lifecycle.start('server') is the key 'server:start': register a hook under it with addSingleton. As tags, stages also work with collect().

Type Parameters ​

S ​

S extends string = string

Example ​

ts
const stages = createLifecycle(['migrate', 'init', 'start']);
stages.migrate('schema'); // 'schema:migrate'

Released under the MIT License.