Mitt
Direct Subclass:
Indirect Subclass:
이벤트 이미터 기능을 제공하는 클래스.
Constructor Summary
| Public Constructor | ||
| public |
|
|
Method Summary
| Public Methods | ||
| public |
addEventListener(type: string | symbol, handler: EventHandler<any>): *
|
|
| public |
Invoke all handlers for the given type. |
|
| public |
Remove an event handler for the given type. |
|
| public |
on(type: string | symbol, handler: EventHandler<any>): * Register an event handler for the given type. |
|
| public |
once(type: *, handler: *) |
|
| public |
removeEventListener(type: string | symbol, handler: EventHandler<any>): *
|
|
Public Constructors
public constructor() source
Public Methods
public addEventListener(type: string | symbol, handler: EventHandler<any>): * source
on() 메소드의 alias
Params:
| Name | Type | Attribute | Description |
| type | string | symbol | Type of event to listen for, or |
|
| handler | EventHandler<any> | Function to call in response to given event |
Return:
| * |
public emit(type: string | symbol, evt: Any) source
Invoke all handlers for the given type.
If present, '*' handlers are invoked after type-matched handlers.
Note: Manually firing '*' handlers is not supported.
Params:
| Name | Type | Attribute | Description |
| type | string | symbol | The event type to invoke |
|
| evt | Any |
|
Any value (object is recommended and powerful), passed to each handler |
public off(type: string | symbol, handler: EventHandler<any>}) source
Remove an event handler for the given type.
If handler is omitted, all handlers of the given type are removed.
Params:
| Name | Type | Attribute | Description |
| type | string | symbol | Type of event to unregister |
|
| handler | EventHandler<any>} |
|
Handler function to remove |
public on(type: string | symbol, handler: EventHandler<any>): * source
Register an event handler for the given type.
Params:
| Name | Type | Attribute | Description |
| type | string | symbol | Type of event to listen for, or |
|
| handler | EventHandler<any> | Function to call in response to given event |
Return:
| * |
public once(type: *, handler: *) source
Params:
| Name | Type | Attribute | Description |
| type | * | ||
| handler | * |
public removeEventListener(type: string | symbol, handler: EventHandler<any>): * source
off() 메소드의 alias
Params:
| Name | Type | Attribute | Description |
| type | string | symbol | Type of event to unregister |
|
| handler | EventHandler<any> |
|
Handler function to remove |
Return:
| * |
