Constructor
new EventManager()
Create a eventManager.
- License:
- MIT
- MIT
- Source:
Methods
afterDelete()
Helper methods.
Delete this callback.
Delete this callback.
- Source:
delete()
Helper methods.
Delete this callback.
Delete this callback.
- Source:
eventInfo(name, key, value)
change event info.
Parameters:
Name | Type | Description |
---|---|---|
name |
event name. | |
key |
event info key. | |
value |
event info value. |
- Source:
filter(callback)
Helper methods.
Parameters:
Name | Type | Description |
---|---|---|
callback |
EventManager~filterCallback |
- Source:
have(name) → {boolean}
Whether to include the specified event.
Parameters:
Name | Type | Description |
---|---|---|
name |
- Source:
Returns:
- Type
- boolean
isEventCallbackRun(name) → {boolean}
if the event callback is running, it returns true.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | RegExp | The event name. It can be a regexp(exact match). |
- Source:
Returns:
- Type
- boolean
isOk(callback)
Helper methods.
isOk.
isOk.
Parameters:
Name | Type | Description |
---|---|---|
callback |
EventManager~isOkCallback |
- Source:
isStop()
Determines whether the EventManager is stopped.
- Source:
killEventCallback(name)
kill the designated event callback.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | RegExp | The event name. It can be a regexp(exact match). |
- Source:
on(name, conf, callback, immediately)
on a event callback.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name |
String | The event name. | |
conf |
Object | The event callback conf. | |
callback |
EventManager~eventCallback | The event callback. | |
immediately |
Boolean | false |
- Source:
onAsync(name, conf, callback, immediately)
on a async event callback.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name |
String | The event name. | |
conf |
Object | The event callback conf. | |
callback |
EventManager~eventCallback | The event callback. | |
immediately |
Boolean | false |
- Source:
stop()
Stop EventManager.
- Source:
times(value)
Helper methods.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | times. |
- Source:
timesFilter(value)
Helper methods.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | times. |
- Source:
trigger(name, info)
trigger a event.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The event name. |
info |
Object | The event info. |
- Source:
triggers(nameRegExp, info)
trigger a event.
Parameters:
Name | Type | Description |
---|---|---|
nameRegExp |
RegExp | The event name RegExp. |
info |
Object | The event info. |
- Source:
update()
Update evnManager.
- Source:
wait(value)
Helper methods.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | sec. |
- Source:
waitFilter(value)
Helper methods.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | sec. |
- Source:
Type Definitions
eventCallback(eventManager, callback)
This eventCallback is added a event event.
Parameters:
Name | Type | Description |
---|---|---|
eventManager |
EventManager | |
callback |
Object | info. |
- Source:
filterCallback() → {Boolean}
This filterCallback is added a event event.
- Source:
Returns:
The callback function executes the result.
- Type
- Boolean
isOkCallback() → {Boolean}
This isOkCallback is added a event event.
- Source:
Returns:
The callback function executes the result.
- Type
- Boolean