@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 863 B
Markdown
lang: en
title: 'API docs: context.contextview.observe'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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
<b>Signature:</b>
```typescript
observe(event: ContextEventType, binding: Readonly<Binding<unknown>>): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | <code>ContextEventType</code> | |
| binding | <code>Readonly<Binding<unknown>></code> | |
<b>Returns:</b>
`void`