Page Contents

Home > @loopback/context > Context > on

Context.on() method

The “bind” event is emitted when a new binding is added to the context. The “unbind” event is emitted when an existing binding is removed.

Signature:

on(eventName: 'bind' | 'unbind', listener: ContextEventListener): this;

Parameters

Parameter Type Description
eventName ‘bind’ | ‘unbind’ The name of the event - always bind or unbind.
listener ContextEventListener The listener function to call when the event is emitted.

Returns:

this