@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
81 lines (41 loc) • 1.71 kB
Markdown
---
lang: en
title: 'API docs: context.contextsubscriptionmanager.notifyobservers'
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.contextsubscriptionmanager.notifyobservers.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ContextSubscriptionManager](./context.contextsubscriptionmanager.md) > [notifyObservers](./context.contextsubscriptionmanager.notifyobservers.md)
## ContextSubscriptionManager.notifyObservers() method
Publish an event to the registered observers. Please note the notification is queued and performed asynchronously so that we allow fluent APIs such as `ctx.bind('key').to(...).tag(...);` and give observers the fully populated binding.
**Signature:**
```typescript
protected notifyObservers(event: ContextEvent, observers?: Set<ContextEventObserver> | undefined): Promise<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">
[ContextEvent](./context.contextevent.md)
</td><td markdown="1">
Context event
</td></tr>
<tr><td markdown="1">
observers
</td><td markdown="1">
Set<[ContextEventObserver](./context.contexteventobserver.md)<!-- -->> \| undefined
</td><td markdown="1">
_(Optional)_ Current set of context observers
</td></tr>
</tbody></table>
**Returns:**
Promise<void>