@loopback/docs
Version:
Documentation for LoopBack 4
31 lines (19 loc) • 829 B
Markdown
lang: en
title: 'API docs: context.context.close'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.context.close.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [close](./context.context.close.md)
## Context.close() method
Close the context: clear observers, stop notifications, and remove event listeners from its parent context.
<b>Signature:</b>
```typescript
close(): void;
```
<b>Returns:</b>
`void`
## Remarks
This method MUST be called to avoid memory leaks once a context object is no longer needed and should be recycled. An example is the `RequestContext`<!-- -->, which is created per request.