- EventHandle
Events with closures.
- createEventHandle([config]) ⇒
function
Returns a function that triggers an event. The function has members such as
.handle()
to add a handler,.id
(a string),.handlerCount()
and.removeAllHandlers()
.- isEventHandle(fn) ⇒
boolean
Returns true if
fn
is a function created bycreateEventHandle
.- onEvent(evt, handler, [options]) ⇒
function
Adds a handler to the given event.
- EventHandleConfiguration :
object
- EventHandlerOptions :
object
Events with closures.
Kind: global variable
- EventHandle
- .create ⇒
function
- .isEventHandle ⇒
boolean
- .on ⇒
function
- .create ⇒
Returns a function that triggers an event. The function has members such
as .handle()
to add a handler, .id
(a string), .handlerCount()
and
.removeAllHandlers()
.
Kind: static property of EventHandle
Returns: function
- The event.
Param | Type | Description |
---|---|---|
[config] | EventHandleConfiguration | string |
Event id or configuration. |
Returns true if fn
is a function created by createEventHandle
.
Kind: static property of EventHandle
Returns: boolean
- True if the given fn is an EventHandle.
Param | Type | Description |
---|---|---|
fn | function |
The function to check. |
Adds a handler to the given event.
Kind: static property of EventHandle
Returns: function
- A function to remove the handler.
Param | Type | Description |
---|---|---|
evt | function |
The event to add a handler to. |
handler | function |
The handler function for the event. |
[options] | EventHandlerOptions |
Options for the handler. |
Returns a function that triggers an event. The function has members such
as .handle()
to add a handler, .id
(a string), .handlerCount()
and
.removeAllHandlers()
.
Kind: global function
Returns: function
- The event.
Param | Type | Description |
---|---|---|
[config] | EventHandleConfiguration | string |
Event id or configuration. |
Returns true if fn
is a function created by createEventHandle
.
Kind: global function
Returns: boolean
- True if the given fn is an EventHandle.
Param | Type | Description |
---|---|---|
fn | function |
The function to check. |
Adds a handler to the given event.
Kind: global function
Returns: function
- A function to remove the handler.
Param | Type | Description |
---|---|---|
evt | function |
The event to add a handler to. |
handler | function |
The handler function for the event. |
[options] | EventHandlerOptions |
Options for the handler. |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[id] | string |
Event identifier (typically a name). |
[before] | function |
Function to be called before event handlers. |
[after] | function |
Function to be called after event handlers. |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[once] | boolean |
True if the handler should be called only once. |
[prepend] | boolean |
True if the handler should be inserted first. |