@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 949 B
Markdown
---
lang: en
title: 'API docs: core.application.lifecycleobserver'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.core.application.lifecycleobserver.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/core](./core.md) > [Application](./core.application.md) > [lifeCycleObserver](./core.application.lifecycleobserver.md)
## Application.lifeCycleObserver() method
Register a life cycle observer class
<b>Signature:</b>
```typescript
lifeCycleObserver<T extends LifeCycleObserver>(ctor: Constructor<T>, name?: string): Binding<T>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ctor | <code>Constructor<T></code> | A class implements LifeCycleObserver |
| name | <code>string</code> | Optional name for the life cycle observer |
<b>Returns:</b>
`Binding<T>`