ig-types 6.10.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event.js +12 -3
- package/package.json +1 -1
package/event.js
CHANGED
|
@@ -63,6 +63,11 @@ module.TRIGGER = module.EventCommand('TRIGGER')
|
|
|
63
63
|
// -> true
|
|
64
64
|
// -> false
|
|
65
65
|
//
|
|
66
|
+
// trigger event handlers and overload handler arguments...
|
|
67
|
+
// handle(true, ...)
|
|
68
|
+
// -> true
|
|
69
|
+
// -> false
|
|
70
|
+
//
|
|
66
71
|
// prevent event handlers from triggering...
|
|
67
72
|
// handle(false)
|
|
68
73
|
// -> undefined
|
|
@@ -151,11 +156,15 @@ object.Constructor('Eventful', {
|
|
|
151
156
|
// NOTE: to explicitly disable calling the handlers func must
|
|
152
157
|
// call handle(false)
|
|
153
158
|
var did_handle = false
|
|
154
|
-
var handle = function(run=true){
|
|
159
|
+
var handle = function(run=true, ...alt_args){
|
|
155
160
|
did_handle = true
|
|
156
|
-
var a =
|
|
157
|
-
|
|
161
|
+
var a = (run === true
|
|
162
|
+
&& arguments.length > 1) ?
|
|
163
|
+
alt_args
|
|
158
164
|
: args
|
|
165
|
+
a = a[0] instanceof EventCommand ?
|
|
166
|
+
a.slice(1)
|
|
167
|
+
: a
|
|
159
168
|
return run ?
|
|
160
169
|
handlers
|
|
161
170
|
.reduce(function(res, handler){
|