Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MediatorMap

Mediator map utility represents a list of view component/interface mappings to their Mediator classes.

author

Jānis Radiņš / Kristaps Peļņa

Hierarchy

  • MediatorMap

Index

Methods

hasMediators

  • hasMediators(instance: any): boolean
  • Check if some instance has mediators mapped to it

    Parameters

    • instance: any

      Display object instance that should be checked fro mediators.

    Returns boolean

    True if mediators mapped for this instance are found or false

map

  • map(type: Type<any> | any, mediator: Type<any>): boolean
  • Map display object to mediator class.

    Parameters

    • type: Type<any> | any

      Display object type or abstract class type which to map to mediator.

    • mediator: Type<any>

      A mediator class which should be created as instance of type is created.

    Returns boolean

    true if mediator is created successfully or false if type been already mapped to requested mediator class.

mediate

  • mediate(instance: any): boolean
  • Check if instance is part of any mediator map binding known to this class. And if so, mediator or several of them will be created for instance or nothing at all will happen.

    Parameters

    • instance: any

      Display object instance whose mediators should be created.

    Returns boolean

    true if any of mediators have been created.

unMap

  • unMap(type: Type<any> | any, mediator: Type<any>): boolean
  • Remove mediator mapping for type.

    Parameters

    • type: Type<any> | any

      Display object type or abstract class mapping to which should be removed from mediator map.

    • mediator: Type<any>

      A mediator class binding from which should be removed.

    Returns boolean

    true if mediator mapping was found and sucessfully removed or false otherwise.

unMediate

  • unMediate(instance: any): boolean
  • Remove any mediators created for instance.

    Parameters

    • instance: any

      Display object instance whose mediators should be removed.

    Returns boolean

    true if any mediators have been removed.