Page Contents

Home > @loopback/core > Application > lifeCycleObserver

Application.lifeCycleObserver() method

Register a life cycle observer class

Signature:

lifeCycleObserver<T extends LifeCycleObserver>(ctor: Constructor<T>, nameOrOptions?: string | BindingFromClassOptions): Binding<T>;

Parameters

Parameter Type Description
ctor Constructor<T> A class implements LifeCycleObserver
nameOrOptions string | BindingFromClassOptions (Optional) Optional name or options for the life cycle observer

Returns:

Binding<T>