EventHandler
General event handler implementation.
Constructor Summary
| Public Constructor | ||
| public | 
      
       | 
    |
Member Summary
| Public Members | ||
| public | 
       eventListeners: *[]  | 
    |
Method Summary
| Public Methods | ||
| public | 
      
       Adds an event listener that is called when EventHandler#callEventListeners is called.  | 
    |
| public | 
       callEventListeners(transaction: Transaction, event: YEvent) Call all event listeners that were added via EventHandler#addEventListener.  | 
    |
| public | 
       destroy() To prevent memory leaks, call this method when the eventListeners won't be used anymore.  | 
    |
| public | 
      
       Removes all event listeners.  | 
    |
| public | 
      
       Removes an event listener.  | 
    |
Public Constructors
public constructor() source
Public Members
public eventListeners: *[] source
Public Methods
public addEventListener(f: Function) source
Adds an event listener that is called when EventHandler#callEventListeners is called.
Params:
| Name | Type | Attribute | Description | 
| f | Function | The event handler.  | 
    
public callEventListeners(transaction: Transaction, event: YEvent) source
Call all event listeners that were added via EventHandler#addEventListener.
Params:
| Name | Type | Attribute | Description | 
| transaction | Transaction | The transaction object // TODO: do we need this?  | 
    |
| event | YEvent | An event object that describes the change on a type.  | 
    
public destroy() source
To prevent memory leaks, call this method when the eventListeners won't be used anymore.
public removeEventListener(f: Function) source
Removes an event listener.
Params:
| Name | Type | Attribute | Description | 
| f | Function | The event handler that was added with EventHandler#addEventListener  | 
    
    
  