@loopback/docs
Version:
Documentation for LoopBack 4
36 lines (23 loc) • 1.35 kB
Markdown
lang: en
title: 'API docs: context.contextsubscriptionmanager.notifyobservers'
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.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.
<b>Signature:</b>
```typescript
protected notifyObservers(event: ContextEvent, observers?: Set<ContextEventObserver> | undefined): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| event | <code>ContextEvent</code> | Context event |
| observers | <code>Set<ContextEventObserver> | undefined</code> | Current set of context observers |
<b>Returns:</b>
`Promise<void>`