---
lang: en
title: 'API docs: context.contextview.once_2'
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_2.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; [once](./context.contextview.once_2.md)

## ContextView.once() method

The "refresh" event is emitted when the view is refreshed as bindings are added/removed.

**Signature:**

```typescript
once(eventName: 'refresh', listener: () => void): this;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

eventName


</td><td>

'refresh'


</td><td>

The name of the event - always `refresh`<!-- -->.


</td></tr>
<tr><td>

listener


</td><td>

() =&gt; void


</td><td>

The listener function to call when the event is emitted.


</td></tr>
</tbody></table>

**Returns:**

this


