A base Mediator implementation.

View

Mediator

Hierarchy (view full)

Implements

Constructors

  • Constructor.

    Parameters

    • Optionalname: string

      Optional name for the mediator. Defaults to Mediator.NAME.

    • OptionalviewComponent: any

      Optional view component associated with the mediator.

    Returns Mediator

Properties

_name: string

the mediator name

_viewComponent?: any

The view component

facade: IFacade = ...

Return the Singleton Facade instance

The facade instance.

NAME: string = "Mediator"

The default name for the mediator.

Accessors

  • get name(): string
  • the mediator name

    Returns string

    The name of the mediator.

  • get viewComponent(): any
  • Get the Mediator's view component.

    Additionally, an implicit getter will usually be defined in the subclass that casts the view object to a type, like this:

    Returns any

    The view component.

  • set viewComponent(value): void
  • Set the Mediator's view component.

    Parameters

    • value: any

      The new view component.

    Returns void

Methods

  • Handle Notifications.

    Typically, this will be handled in a switch statement, with one 'case' entry per Notification the Mediator is interested in.

    Parameters

    Returns void

  • List the Notification names this Mediator is interested in being notified of.

    Returns string[]

    An array of notification names.

  • Called by the View when the Mediator is registered

    Returns void

  • Called by the View when the Mediator is removed

    Returns void

  • 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