@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
83 lines (43 loc) • 1.45 kB
Markdown
---
lang: en
title: 'API docs: context.contextview.once_1'
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.once_1.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ContextView](./context.contextview.md) > [once](./context.contextview.once_1.md)
## ContextView.once() method
The "unbind" event is emitted a new binding is removed from the view.
**Signature:**
```typescript
once(eventName: 'unbind', listener: <V>(event: ContextViewEvent<V> & {
cachedValue?: V;
}) => void): this;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
eventName
</td><td markdown="1">
'unbind'
</td><td markdown="1">
The name of the event - always `unbind`<!-- -->.
</td></tr>
<tr><td markdown="1">
listener
</td><td markdown="1">
<V>(event: [ContextViewEvent](./context.contextviewevent.md)<!-- --><V> & { cachedValue?: V; }) => void
</td><td markdown="1">
The listener function to call when the event is emitted.
</td></tr>
</tbody></table>
**Returns:**
this