Constructor
new Handler(calleropt, methodopt, argsopt, once)
Creates a value based on the specified property value
Handler
Class instance.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
caller |
Object
|
<optional> |
null | caller Execution domain. |
method |
function
|
<optional> |
null | method Processing function. |
args |
Array
|
<optional> |
null | args Function parameter. |
once |
Boolean
|
Do you execute only once?. |
Member
args :Array
Parameter.
caller :Object
Execute domain (this).
method :function
Treatment method.
once :Boolean
Indicates whether it is executed only once. If true, callback recover () after the recovery, recovery will be re used, the default is false.
Methods
clear()
Clear object reference.
create(caller, method, argsopt, once) → {Handler}
Create a Handler from the object pool, which defaults to execute once and reclaims immediately, and if you don't need to automatically recycle, set the once parameter to false.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
caller |
Object
|
Execute domain (this). | ||
method |
function
|
Callback method. | ||
args |
Array
|
<optional> |
null | args Carried parameters. |
once |
Boolean
|
Is it executed only once, and if true, recover () is executed after callback, the default is true. |
recover()
Clean up and recycle to Handler Object pool.
run()
Executive processor.
runWith(data)
Execute the processor to carry additional data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
Additional callback data can be either single data or Array (as a multi parameter). |
setTo(caller, method, args, once) → {Handler}
Sets the specified property value for this object.
Parameters:
Name | Type | Description |
---|---|---|
caller |
Object
|
Execute domain (this). |
method |
function
|
Callback method. |
args |
Array
|
Carried parameters. |
once |
Boolean
|
Do you only execute once? If true, recover () is executed after execution. |