Simple library to work with custom events.
(require("neva"))( [target])
Create event emitter or add methods to work with events into specified object.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
target |
Object |
<optional> |
Object that should be enhanced by methods to work with events.
If |
Returns:
Value of target parameter or new object that is enhanced by methods to work with events.
Type Definitions
-
EventData
-
Data about emitted event.
Type:
- Object
Properties:
Name Type Description typestring The event type (value of
typeparameter passed in EventEmitterMixin.emit method).paramsArray List of additional parameters that are passed besides the event type in EventEmitterMixin.emit method.
dataany Value of the first additional parameter that is passed in EventEmitterMixin.emit method (value of
params[0]). -
EventEmitter
-
An object that has methods to work with events.
Type:
- Object
- Mixes In:
-
HandlerSettings
-
Event handler settings.
Type:
- Object
Properties:
Name Type Argument Default Description onceboolean <optional>
false Whether event handler should be called just once.