---
lang: en
title: 'API docs: context.contextview.on_4'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.contextview.on_4.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [ContextView](./context.contextview.md) &gt; [on](./context.contextview.on_4.md)

## ContextView.on() method

The "close" event is emitted when the view is closed (stopped observing context events)

<b>Signature:</b>

```typescript
on(eventName: 'close', listener: () => void): this;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  eventName | 'close' | The name of the event - always <code>close</code>. |
|  listener | () =&gt; void | The listener function to call when the event is emitted. |

<b>Returns:</b>

this


