Constructor
new EmbeddedEvent()
Properties:
Name | Type | Description |
---|---|---|
_listeners |
Array.<Help4.EmbeddedEvent.Listener> | event listeners |
_priorities |
Array.<Help4.EmbeddedEvent.Priority> | listener priorities |
- Source:
Extends
Members
(static) PRIORITY :Object
Type:
- Object
- Source:
Methods
(protected) ____defineStaticProperties()
auto define all to be cleaned properties
- Overrides:
- Source:
Throws:
Error
(protected) ____getClassConfig() → {Help4.jscore.Base.Params}
- Overrides:
- Source:
Returns:
(protected) ____mergeDerivedParam(level0, type, value)
Parameters:
Name | Type | Description |
---|---|---|
level0 |
Help4.jscore.Base.Params | |
type |
string | |
value |
* |
- Overrides:
- Source:
Throws:
Error
(protected) ____mergeDerivedParams(level0, level1)
Parameters:
Name | Type | Description |
---|---|---|
level0 |
Help4.jscore.Base.Params | |
level1 |
Help4.jscore.Base.Params |
- Overrides:
- Source:
Throws:
Error
(protected) ____resolveDerivedParams(classConfig)
Parameters:
Name | Type | Description |
---|---|---|
classConfig |
Help4.jscore.Base.Params |
- Overrides:
- Source:
(protected) _destroyControl(…keys)
destroys class properties
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
string |
<repeatable> |
- Overrides:
- Source:
(protected) _fireEvent(event) → {Help4.jscore.Base}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
(async, protected) _fireEvent2(event) → {Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>
(protected) _fireEventSync(event) → {Array.<Help4.EmbeddedEvent.EventResponse>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Array.<Help4.EmbeddedEvent.EventResponse>
addListener(listener, priorityopt) → {Help4.EmbeddedEvent}
add a listener to the EmbeddedEvent
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
listener |
Help4.EmbeddedEvent.Listener | the callback function | |
priority |
Help4.EmbeddedEvent.Priority |
<optional> |
- Overrides:
- Source:
Returns:
- Type
- Help4.EmbeddedEvent
addListenerSync(eventType, listener) → {Help4.jscore.Base}
add an event listener
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | Array.<string> | event type to be observed |
listener |
Help4.EmbeddedEvent.Listener | the callback function |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
countListeners() → {number}
returns the number of subscribed listeners
- Source:
Returns:
- Type
- number
destroy()
destroy instance
- Overrides:
- Source:
isDestroyed() → {boolean}
whether instance is destroyed
- Overrides:
- Source:
Returns:
- Type
- boolean
onEvent(data, priorityopt) → {Help4.EmbeddedEvent}
send an event to all callbacks
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object | ||
priority |
Help4.EmbeddedEvent.Priority |
<optional> |
- Source:
Throws:
Error
Returns:
- Type
- Help4.EmbeddedEvent
(async) onEvent2(data, priorityopt) → {Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>}
send an event to all callbacks; delivers the return value
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object | ||
priority |
Help4.EmbeddedEvent.Priority |
<optional> |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>
removeListener(listener) → {Help4.EmbeddedEvent}
remove a listener from the EmbeddedEvent
Parameters:
Name | Type | Description |
---|---|---|
listener |
Help4.EmbeddedEvent.Listener | the to be removed callback function |
- Overrides:
- Source:
Returns:
- Type
- Help4.EmbeddedEvent
Type Definitions
EventResponse
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | event response type | |
scope |
Object |
<optional> |
responder |
response |
* |
<optional> |
result value |
- Source:
Listener(data)
Parameters:
Name | Type | Description |
---|---|---|
data |
Object |
- Source:
Priority
Type:
- 'high' | 'normal'
- Source: