diff --git a/event.js b/event.js index 6f5c426..2a54bad 100644 --- a/event.js +++ b/event.js @@ -63,6 +63,11 @@ module.TRIGGER = module.EventCommand('TRIGGER') // -> true // -> false // +// trigger event handlers and overload handler arguments... +// handle(true, ...) +// -> true +// -> false +// // prevent event handlers from triggering... // handle(false) // -> undefined @@ -151,11 +156,15 @@ object.Constructor('Eventful', { // NOTE: to explicitly disable calling the handlers func must // call handle(false) var did_handle = false - var handle = function(run=true){ + var handle = function(run=true, ...alt_args){ did_handle = true - var a = args[0] instanceof EventCommand ? - args.slice(1) + var a = (run === true + && arguments.length > 1) ? + alt_args : args + a = a[0] instanceof EventCommand ? + a.slice(1) + : a return run ? handlers .reduce(function(res, handler){ diff --git a/package.json b/package.json index b0b6a64..c426a02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-types", - "version": "6.10.0", + "version": "6.10.1", "description": "Generic JavaScript types and type extensions...", "main": "main.js", "scripts": {