new Eventing_A()
Event manager base class
- Source
const eventingInstance = new TComponents.Eventing_A();Methods
anyEvent() → {boolean}
Check if any event has been registered already
- Source
- True if any event has been registered already, false otherwise
- Type:
- boolean
cleanEvent(eventName)
Clean up a specific event
| Name | Type | Description |
|---|---|---|
eventName | string | The event name you want to clean |
- Source
cleanUpEvents(ignoresopt)
Clean up all registered events except those in the ignore list
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
ignores | Array.<string> | <optional> | ['before:init', 'after:render', 'before:destroy'] | Event list you don't want to clean |
- Source
count(eventName) → {number}
Get the number of callbacks subscribed to an event
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the triggering event |
- Source
- Number of callbacks subscribed to the event
- Type:
- number
hasEvent(eventName) → {boolean}
Check if an event has been registered already
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the triggering event |
- Source
- True if the event has been registered already, false otherwise
- Type:
- boolean
off(eventName, callback) → {boolean}
Unsubscribe from an event
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the triggering event |
callback | function | Function to be removed from the event's callbacks |
- Source
- True if the callback was removed, false if it was not found
- Type:
- boolean
on(eventName, callback, strictopt)
Subscribe to an event
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
eventName | string | Name of the triggering event | ||
callback | function | Function to be called when the event is triggered | ||
strict | boolean | <optional> | true | If true (default), checking whether the function has been added is done by function object comparison, otherwise, the comparison is done only by function.name |
- Source
once(eventName, callback) → {boolean}
Subscribe to an event, but the callback is called only once
| Name | Type | Description |
|---|---|---|
eventName | string | Name of the triggering event |
callback | function | Function to be called when the event is triggered |
- Source
- True if the callback was added, false if it was already added
- Type:
- boolean