@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
91 lines (45 loc) • 1.43 kB
Markdown
---
lang: en
title: 'API docs: context.contextview.observe'
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.observe.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ContextView](./context.contextview.md) > [observe](./context.contextview.observe.md)
## ContextView.observe() method
Listen on `bind` or `unbind` and invalidate the cache
**Signature:**
```typescript
observe(event: ContextEventType, binding: Readonly<Binding<unknown>>, context: Context): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
event
</td><td markdown="1">
[ContextEventType](./context.contexteventtype.md)
</td><td markdown="1">
</td></tr>
<tr><td markdown="1">
binding
</td><td markdown="1">
Readonly<[Binding](./context.binding.md)<!-- --><unknown>>
</td><td markdown="1">
</td></tr>
<tr><td markdown="1">
context
</td><td markdown="1">
[Context](./context.context.md)
</td><td markdown="1">
</td></tr>
</tbody></table>
**Returns:**
void