Kind: global namespace
- Mediator
- new Mediator(eventEmitter, setting)
- instance
- .addComponent(name, registrator)
- .removeComponent(name) ⇒
boolean
- .hasComponent(name) ⇒
boolean
- .getComponent(name) ⇒
Object
- .componentsList() ⇒
Array
- .shareResponsibility(mediator)
- .toString() ⇒
string
- static
Mediator - Provide ability to you create a simple mediator to control interaction among components based on low coupling
Param | Type |
---|---|
eventEmitter | EventEmitter |
setting | Object |
Method provides ability to add component
Kind: instance method of Mediator
Param | Type |
---|---|
name | string |
registrator | function |
Method removes existing component, unattached event handlers for component and remove dependencies
Kind: instance method of Mediator
Returns: boolean
- True if component was removed in opposite false
Param | Type | Description |
---|---|---|
name | string |
Component Name |
Method provides you ability to check component existence by name
Kind: instance method of Mediator
Param | Type |
---|---|
name | string |
Method provides component by name
Kind: instance method of Mediator
Param | Type |
---|---|
name | string |
Method provides components' names list for all registered components
Kind: instance method of Mediator
Returns: Array
- Array that contains string names of each registered component
Method can be used if you want to share events among several mediators in application
Kind: instance method of Mediator
Param | Type |
---|---|
mediator | Mediator |
Return string for Instance of Mediator [object Mediator]
Kind: instance method of Mediator
Kind: static constant of Mediator
Event with this name is emitted every time when new component is registered in system
Kind: static constant of EVENTS
Event with this name is emitted every time when component is removed in system
Kind: static constant of EVENTS