@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
65 lines (34 loc) • 1.59 kB
Markdown
---
lang: en
title: 'API docs: core.lifecycleobserverregistry.sortobserverbindingsbygroup'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/core
permalink: /doc/en/lb4/apidocs.core.lifecycleobserverregistry.sortobserverbindingsbygroup.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/core](./core.md) > [LifeCycleObserverRegistry](./core.lifecycleobserverregistry.md) > [sortObserverBindingsByGroup](./core.lifecycleobserverregistry.sortobserverbindingsbygroup.md)
## LifeCycleObserverRegistry.sortObserverBindingsByGroup() method
Sort the life cycle observer bindings so that we can start/stop them in the right order. By default, we can start other observers before servers and stop them in the reverse order
**Signature:**
```typescript
protected sortObserverBindingsByGroup(bindings: Readonly<Binding<LifeCycleObserver>>[]): LifeCycleObserverGroup[];
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
bindings
</td><td markdown="1">
Readonly<[Binding](./context.binding.md)<!-- --><[LifeCycleObserver](./core.lifecycleobserver.md)<!-- -->>>\[\]
</td><td markdown="1">
Life cycle observer bindings
</td></tr>
</tbody></table>
**Returns:**
[LifeCycleObserverGroup](./core.lifecycleobservergroup.md)<!-- -->\[\]