The interface definition for a PureMVC Command.

INotification

ICommand

interface ICommand {
    execute(notification: INotification): void;
    sendNotification(notificationName: string, body?: any, type?: string): void;
}

Hierarchy (view full)

Implemented by

Methods

  • Execute the ICommand's logic to handle a given INotification.

    Parameters

    • notification: INotification

      The notification carrying the data and type necessary for executing the command.

    Returns void

  • Send a INotification.

    Convenience method to prevent having to construct new notification instances in our implementation code.

    Parameters

    • notificationName: string

      The name of the notification to send.

    • Optionalbody: any

      Optional data associated with the notification.

    • Optionaltype: string

      Optional type of the notification.

    Returns void