Page Contents

Home > @loopback/context > ContextSubscriptionManager > notifyObservers

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:

protected notifyObservers(event: ContextEvent, observers?: Set<ContextEventObserver> | undefined): Promise<void>;

Parameters

Parameter Type Description
event ContextEvent Context event
observers Set<ContextEventObserver> | undefined (Optional) Current set of context observers

Returns:

Promise<void>