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