A Base Notifier implementation.

MacroCommand, Command, Mediator and Proxy all have a need to send Notifications.

The Notifier interface provides a common method called sendNotification that relieves implementation code of the necessity to actually construct Notifications.

The Notifier class, which all the above-mentioned classes extend, provides an initialized reference to the Facade Singleton, which is required for the convenience method for sending Notifications, but also eases implementation as these classes have frequent Facade interactions and usually require access to the facade anyway.

Hierarchy (view full)

Implements

Constructors

Properties

Methods

Constructors

Properties

facade: IFacade = ...

Return the Singleton Facade instance

The facade instance.

Methods

  • Create and send an Notification.

    Keeps us from having to construct new Notification instances in our implementation code.

    Parameters

    • notificationName: string

      The name of the notification to be sent.

    • Optionalbody: any

      Optional data to be included with the notification.

    • Optionaltype: string

      Optional type of the notification.

    Returns void